The "Error Establishing a Database Connection" is a common and critical WordPress error. It means WordPress cannot connect to the MySQL database where your content is stored. Here is how to fix it.
Fix 1: Check Your wp-config.php File (Most Common)
Sometimes the database credentials in this file get changed or corrupted.
-
Access your site via FTP or cPanel File Manager.
-
Navigate to the root folder (usually
public_html) and find the filewp-config.php. -
Download a backup copy, then edit the file.
-
Look for these three lines:
define('DB_NAME', 'database_name'); define('DB_USER', 'database_user'); define('DB_PASSWORD', 'database_password');
-
Verify these are correct. If you are unsure, log in to cPanel, go to "MySQL Databases" and check your database name and user. You may need to reset the password.
-
Save the file and reload your site.
Fix 2: Repair Your Database
Add this line to your wp-config.php file (just above the "That's all, stop editing" line):
define('WP_ALLOW_REPAIR', true);
Then visit: yourdomain.com/wp-admin/maint/repair.php
Click "Repair Database." Important: After repair, remove that line from your config file!
Fix 3: Check if the Database Server is Overloaded
Sometimes the MySQL server is just too busy. If you have confirmed your credentials are correct, wait a few minutes and try again. If the problem persists, contact BurjHost support.