This article will detail what this error means and how you can fix it.
What does ‘Error establishing a database connection’ mean?
This error occurs when a WordPress website is unable to connect to the database, and there are several reasons why this may happen.
If you’ve recently transferring your WordPress site to a new host, then it’s more than likely that your database no longer features the correct login details. As such, the connection between WordPress and your database will need to be re-established. However, this error will also appear if your database is down or has been corrupted.
How do I resolve this error?
Here are a few different actions you can take to identify and fix this issue:
Check database login credentials
The first thing you should do is check your wp-config.php file to make sure that the login details for your database are still correct.
For details on how to do this, please read the following article: How do I update my WordPress database connection string?
Repair your database
If the details within your wp-config.php file are still correct, then your database may be corrupted.
This isn’t as bad as it sounds though as you can remedy this by inserting the following code into your wp-config.php file:
define(‘WP_ALLOW_REPAIR’, true);
This line of code should be added after the line that states ‘That’s all, stop editing! Happy publishing.’
Restore a backup
If you’re not sure about changing the coding of your website, you can always restore a backup of your WordPress site for when it was previously working.
For details on how to do this, please read the following article: How do I restore my Managed WordPress website?
Contact Support
If none of the above options have resolved the error, please get in touch with our Support team on 0345 450 2310, who will gladly assist you.