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
Minimal one-line ink drawing of a padlock over an offset blue shape, with a small red scribble, on cream paper.
security · November 2, 2026

WordPress Security in October 2026: What to Update

A WordPress core security release, two form plugin attacks, and a breached membership portal. What happened in October 2026 and what to check on your site.

Grainy painterly landscape of calm terraced fields in soft rows under a pale morning sky.
security · November 2, 2026

A 20-Minute Security Check for Your WordPress Site

Six checks any team can run on a WordPress site in about 20 minutes, from updates and admin accounts to backups and form data.

Interlocking translucent ribbons in green, peach, and orange that suggest connected product workflows
mvp · October 29, 2026

Build the Riskiest MVP Workflow First

Scope an MVP around the workflow most likely to fail, then test it with real users before you spend time polishing the rest.