Blog / Guide· March 4, 2023

Fix error establishing connection to database.

Error establishing database connection on your WordPress site is caused by a number of different issues.

Gary Bunofsky

Gary Bunofsky

Lead Developer

A close-up of a textured Venetian plaster surface in neutral beige, featuring dynamic, layered strokes that create depth and a rustic, artistic finish.

If you're seeing the error message "Error establishing database connection" on your WordPress site, it means that WordPress is unable to establish a connection to the database that stores all of your site's content and settings. This error can be caused by a number of different issues, but fortunately, there are a few steps you can take to try and resolve it.

Fix error establishing connection to database

Here's a step-by-step guide on how to fix the "Error establishing database connection" error in WordPress:

  1. Check if the error is still there Sometimes, the error may just be a temporary issue that resolves itself after a few minutes. So, the first thing you should do is to check if the error is still there by refreshing your website page or trying to access the WordPress dashboard.

  2. Check your login credentials The next thing to check is your WordPress login credentials. To do this, navigate to the wp-config.php file in your WordPress installation directory and check the database username, password, and host. Ensure they match the details provided by your web host.

  3. Check your database server status If your login credentials are correct, the next thing to check is your database server status. Check whether the database server is down or experiencing issues. You can try accessing your database server via phpMyAdmin or the command line to confirm.

  4. Check your database server connection details If your database server is running fine, the next thing to check is your database connection details. Make sure that the database name, database username, and database password are all correct. You can find these details in the wp-config.php file in your WordPress installation directory.

  5. Repair your database If none of the above solutions work, the last thing to try is to repair your database. To do this, log into your web hosting account and navigate to the database administration area. Once there, locate the option to repair the database and follow the instructions provided.

  6. Seek help from your web host If you have tried all of the above steps and are still experiencing the error, contact your web host. They can check the database service, server logs, and recent infrastructure changes.

The "Error establishing database connection" message is usually fixable, but repeated outages point to a larger hosting issue. Our managed WordPress hosting includes monitoring, backups, patching, and migration support.

More thinking.

All posts
A megaphone
mobilize · December 1, 2026

How to show Mobilize events on your website.

Use the public Mobilize API to list your upcoming events on your own site. Finding your organization ID, filters, rendering, caching, and RSVPs.

Stacked sheets of paper
everyaction · December 1, 2026

Connecting your website to EveryAction and NGP VAN.

Embed EveryAction forms with ActionTag, or use the NGP VAN API to find or create people and apply activist codes. Auth, access tiers, and examples.

Tall stone pillars in soft light, suggesting a building under construction.
nonprofit · December 1, 2026

Who Designs Capital Campaign Websites for Nonprofits?

Your options for a capital campaign website, what the site needs to do at each phase, and how Loopdash designs and builds them for nonprofits.