WP Maintenance disaster
Error establishing a database connection
As a WordPress owner, this might be awfully frustrating specifically when it took place by itself without you changing anything. You are getting this error because WordPress is not able to establish a database connection. Now the reason WordPress is unable to establish a database connection can differ.
This is how it looks:
HOW to Repair the Error establishing a database connection issue?
It could be that your database login credentials are incorrect or have actually been altered. It could be that your database server is unresponsive. It might be that your database has actually been damaged. In our experience, most of the times this error takes place because of some sort of server mistake nevertheless there could be other elements also.
1 – WP Maintenance disaster – Error establishing a DB connection – WP-ADMIN still works:
First thing you must do is to ensure that you are getting the exact same error on both the front-end of the website and the back-end of the website (wp-admin). If you are getting a various error on the wp-admin, for instance, something like “One or more database tables are unavailable. The database may need to be repaired.”, then you require to repair your database.
You can do this by adding the following line in your wp-config.php file. Include it before the ‘That’s all, stop modifying! Pleased blogging’ line in your wp-config.php file.
define(‘ WP_ALLOW_REPAIR’, true);
Once you have actually done that, you can see the settings by visiting this page:
Keep in mind, the user does not need to be logged in to access this functionality when this specific change is active. This is due to the fact that its main intent is to fix a damaged database. Users normally can’t log in when the database is corrupt. So as soon as you are done repairing and optimizing your database, ensure to eliminate this from your wp-config.php.