Help! Error establishing a database connection

Hi friendly Reclaim Hosting Community,

I have two reclaim sites (since January of this year - prior to January, I had one), and just noticed that one (my first one) is now pointing to “Error establishing a database connection” no matter which link is clicked on the cPanel. I’m guessing that there must be something not right with the database, but I don’t even know where to look to see what is broken, or what to look for. (I’m pretty much a web newbie, though I’m not scared to poke around.) Tips would be greatly appreciated!

Hi there! This is a great question and it likely means that the database information stored in Installatron or the wp-config.php file does not match what the username/pass/database name is in cPanel. We can certainly take a look for you if you want to submit a ticket to with your domain name. This way we can take a deeper look into the error. I’ll also document the solution here for others to reference in the future!

We were able to get this fixed! When the site throws the error: Error establishing a database connection, this usually means there is miscommunication between the database and the files in the file manager. What I like to do from here is open up the Files and Tables section in Installatron.

You’re going to compare the four sections in red to the database file in the File manager.

Open up the file manager and navigate to where the site is installed, in this case, it’s right in the public_html folder. The database file that’s within the installation can vary depending on the application. Since this is a WordPress installation, you’ll work with the wp-config.php file:

You can edit the file right within the File manager, click Edit in toolbar across the top of the screen.

From here just make sure that the database name/username, password, and host all match to the Files and Tables section in Installatron. If any are incorrect, you can change them directly in the wp-config.php file. Once they all match, click Save Changes and reload the site.