Problem Statement
Could not access WordPress Website or WordPress dashboard.Error Statement
Error establishing a database connectionSolution
Normally this error occurs when WordPress is unable to establish a database connection. There are many possible reasons why WordPress is unable to establish a database connection. Following are some possible suggestions to troubleshoot this problem.- Make sure you are using correct WordPress database username and password in wp-config.php file. It is possible that login credentials are wrong or recently changed.
- Make sure that your database server is responsive and working fine.
- When you are unable to access WordPress website and Dashboard, most probably WordPress database is corrupted. You can repair WordPress database with few easy steps. You will have to add following lines in your wp-config.php file:
Once you have done that, browse the wp-admin again, it will repair the database .
Comment