I recently got a report that a site that had been functioning for months, and whose code had been untouched, had just gone down and was displaying the horribly ambiguous WordPress error in black text on a white screen: “Error establishing a database connection”. The website was hosted by BlueHost.
When this happens, it means that WordPress is having trouble communicating with the database you set up for it during install. WordPress is a database-driven website development platform, which means that if it has no database to communicate with, it basically can’t do anything at all.
After doing a little investigating, I found out that the client who owned the website had logged into the BlueHost hosting account and made some changes. Specifically, he changed the account login password that’s used to access and login to your account on the BlueHost website.
What isn’t necessarily made obvious is the fact that when you do this, it also changes your FTP password and database password to the new password you specified for your BlueHost account.
What this means is you’ll need to take that new password and tell WordPress about it so that it can get the information it needs to go back online. In order to do this, you’ll need to edit the wp-config.php file in the main directory of your WordPress install.
Use an FTP client like Filezilla, or BlueHost’s File Manager, to access your site’s WordPress files, and download the wp-config.php file to your computer. Use a text editor like TextEdit or Notepad to edit the wp-config file.
Around line 25 of your wp-config.php file, you’ll see the text:
define(‘DB_PASSWORD’, ‘your old password‘);
Change the old password that’s there to the new password you made when changing your BlueHost account settings. After that, save the wp-config.php file and upload it to the same place you downloaded from. Once that’s complete, your site should be back online again! WordPress needs to make sure your content is secure, which is why it implements a password in the first place. The wp-config.php file has you database and other information if you ever need to reference or change it.
Thanks for reading this post! Mission Bay Media is a San Diego Web Design firm that specializes in Website Design and Internet Web Development. For questions, comments or suggestions, please contact firstname.lastname@example.org.