WordPress Error Establishing a Database Connection

In a nutshell, you are getting this error because WordPress struggles to establish a database connection. Now the key reason why WordPress is unable to begin a database connection can vary. Maybe your database login credentials are wrong or have been changed. It could be that a database server is unresponsive. Maybe your database has been corrupted. In our experience, majority of the times this error happens because of some type of server error however there may be other factors as well. Lets have a look at how to go about troubleshooting this problem.

That message, "Error establishing a database connection", usually means one of two things:
1. Database server is down (not operating)
2. You have wrong information in your wp-config.php--either the DB_HOST, DB_USER, DB_PASSWORD, or DB_NAME is incorrect.

Be sure the database is name is complete and correct along with the database username and that the username is added to the database with all or proper privileges.

The error Error Establishing a Database Connection can also occur if the MySQL / MariaDB service is not up and running. Be sure the service is up and operational.

This can also occur if there is database corruption. Log into your hosting control panel with us and select MySQL the database and repair options.





Share this page:


Was this article useful? Have any suggestions or improvements to the information?

Also Read

Blocked by JetPack

If you have access to your site and you’ve not been blocked, you can enter your IP or IPv6...

Do you have a WordPress plugin slowing you down?

Some WordPress plugins can really bog down your site's performance. P3 Plugin Profile can help in...

WordPress Response Body too Large and Too many arguments in Request Errors

If you are receiving a response body too large error with WordPress it is a result of WordPress...

Improve WordPress Speed and Optimize

With our service there are many ways to speed up the performance of your WordPress website. We...

Static HTML Files Not Being Displayed with WordPress

This can occur when WordPress's .htaccess rewrites take place over the static html file. Place...