Knowledge Base
How to Repair WordPress Error Establishing A Database Connection
If you get a page featuring the message “Error Establishing Database Connection,” this means that there is a problem with the connection to your database and there could be a number of reasons for this. The following are possible reasons and solutions.
Incorrect wp-config.php Information
1.“Error establishing a database connection” is usually caused by an error in your wp-config.php file.
2.Access your site in your cpanel account.
3.Open up wp-config.php and ensure that the following are correct:
define(‘DB_NAME’, ‘database_name’);
define(‘DB_USER’, ‘username’);
define(‘DB_PASSWORD’, ‘password’);
define(‘DB_HOST’, ‘localhost’);
4.Repair database tables: If the database server is functioning correctly, it’s possible that some database tables might be corrupted. To repair them, you can use the built-in repair functionality in Cpanel.