Emergency Rescue Plan active — senior engineer replies within 12 hours See the plan →
Infrastructure · people search: “Error establishing a database connection — how do I fix it?”

Error establishing a database connection — how do I fix it?

This WordPress white screen means the site can't reach its database. The cause is usually small, but the order you fix it in matters. Here's the path.

Plain English · no jargon · 4-minute read

Part of Servers & Infrastructure — read first, then fix it in 48h.

'Error establishing a database — Where your site stores its content and user data; overloaded or corrupted, it throws errors instead of pages. connection' is WordPress giving up because it can't talk to the database that stores every page, user, and order. You'll see a plain white page with that one line. It can be caused by a bad credential after a move, a database server that's down or out of space, or a database that's been corrupted — and the fix differs for each, so identify before you act.

Check these first, yourself

  1. Check your host's panel: is the database server marked online, and how much of its disk quota — A cap on the disk, memory or emails your plan allows; hitting it is a common cause of sudden failures. is used? A full disk is a very common cause.

  2. If you recently moved hosts or changed the site URL, suspect the credentials or hostname in the config file (wp-config.php) before anything else.

  3. Don't start deleting plugins or rewriting files while you're guessing — you can turn a recoverable fault into real data loss.

  4. If the database itself is damaged, stop writing to it and take a copy first; every further write reduces what can be recovered.

Should you fix it yourself or call a rescue?

Have you tried the free fixes (images, caching, plugins)?If yes and it's still slow → the problem is deeper.
Is your hosting or server the bottleneck?Shared hosting, old PHP, no object cache → server-level problem.

Still have questions?

Did I lose all my content when this error appeared?

Almost never. The data is usually still on disk; the site simply can't open it. In most cases the database is repaired from a snapshot and content comes back intact — which is why stopping writes early matters.

Can my host fix it for me?

Hosts will confirm the database service is running and may restore a recent snapshot, but they won't repair a corrupted schema or untangle a bad migration. That's the part that needs the rescue.

Don't want to become an expert in this?

Send the symptom — get a flat-rate ticket and a plain-English plan within 12 hours.

Start the Rescue