All Systems Operational|support@delhihosting.com
WordPress

How to Fix "Error Establishing a Database Connection"

1 Mar 2026 · 5 min read · DelhiHosting Team

"Error establishing a database connection" stops your whole site, but it usually has a handful of fixable causes. Here’s how to track it down calmly.

Check the credentials

WordPress connects using the database name, user, password and host in wp-config.php. If any of these are wrong — often after a migration — the connection fails. Confirm they match the database details in cPanel.

Look at the database itself

The database server may be overloaded or the database may need repair. Check with your host, and use the built-in WordPress repair tool (enable it in wp-config.php) to fix corrupted tables.

Rule out server load

A traffic spike or a resource-heavy plugin can exhaust database connections. If the error comes and goes, it often points to load — caching and a larger plan usually resolve it. Our support can confirm what’s happening.

Quick tips
  • Verify wp-config.php database details
  • Repair the database if tables are corrupt
  • Check for overload if it’s intermittent
  • Contact support to confirm server status
Key takeaway

This error is almost always wrong credentials, a corrupt database, or server load — check each in turn and it’s quickly resolved.

Related WordPress guides

Need a hand with this?

Our Delhi-based engineers set up, secure and speed up WordPress for you — free migration included.