Error establishing a database connection fixes for WordPress
If you have a WordPress blog and frequently run into the “Error establishing a database connection” message, there are several areas you can check to resolve this issue.
The most obvious check is to make sure that your username and password for your database is set correctly within the wp-config.php file for your WordPress setup.
If those settings are correct, also make sure that you aren’t running into any user database connection limits set by your hosting provider. Some hosting providers will throttle connections after a certain simultaneous limit (e.g. your blog can not have any more than 10 users at the same time). Also, check to make sure that your server isn’t down.
The last fix is to check your wp-config.php file and if you are using ‘localhost’ as the DB_HOST parameter, make sure it’s capitalized.
Therefore:
define(‘DB_HOST’, ‘localhost’); // 99% chance…
Should be changed to:
define(‘DB_HOST’, ‘Localhost’); // 99% chance…
