This error means WordPress cannot connect to your database.

Why This Error Happens

Method 1: Check wp-config.php

define('DB_NAME', 'database_name');
define('DB_USER', 'database_user');
define('DB_PASSWORD', 'database_password');
define('DB_HOST', 'localhost');

Method 2: Repair Database

Add this temporarily to wp-config.php:

define('WP_ALLOW_REPAIR', true);

Visit:

/wp-admin/maint/repair.php

Method 3: Contact Hosting Provider

If credentials are correct, your database server may be down.

How to Prevent This Error

Leave a Reply

Your email address will not be published. Required fields are marked *