Home / Fix a Problem / Site Down or Erroring / Error establishing database connection

This error means WordPress could not open a connection to its database. There are only a handful of reasons: the credentials in wp-config no longer match, the database server is down or refusing connections, the database has hit a connection or resource limit, or a table has been corrupted. Which one it is determines whether this is a two-minute fix or a repair job.

Before you buy, one quick look

This is read-only. Do not edit any files.

If you host more than one site on the same account, load one of the others. Then check your host status page for a reported outage.

Other sites are also down — it is the host, not your site. Contact them first; this fix will not help until their database server is back.

Only this site is down — it is credentials, limits or table corruption. That is exactly what this covers.

Please do not edit wp-config.php to try credentials. A wrong edit there turns a recoverable problem into a longer one, and it is the first thing we check anyway.

SOS-003

Error establishing database connection

WordPress cannot reach its database and shows a connection error. We check credentials, server status and table health, repair what is broken, and get the site reading and writing again.

$109.32 delivered in 48 hours
Needs Hosting panel, SFTP access and Database access. Create a limited sub-account — we never ask for your own password.
  • Full backup taken before we start
  • If we can’t fix it, you get your money back
  • We never ask for your own password

This or something else?

Error appears on every page including admin This fix covers it
Site works but is very slow, no error Database query performance audit
Error started right after a host migration Broken after host migration
Error mentions a specific crashed table This fix covers it
All sites on the account are down A host outage — contact them first

What you are seeing

  • Every page, including wp-admin, shows the connection error
  • It may have appeared suddenly with no change on your side
  • Sometimes it is intermittent — the site works, then fails, then works again
  • Your host may have emailed about database resource usage

Common causes

  • Database credentials changed at the host and no longer match wp-config
  • The database server is down, overloaded, or refusing new connections
  • A table has been corrupted, often after a crash or a full disk
  • The account hit a connection limit under traffic or from a runaway query
  • A migration finished with the wrong database name, user or host value

What we do

  1. Take a full backup of files and database before touching anything
  2. Verify credentials and connectivity directly against the database server
  3. Check for corrupted tables and repair them where repair is safe
  4. Look for the query or process that exhausted connections, if that is the cause
  5. Correct configuration and confirm the site reads and writes correctly
  6. Load-test the front end, admin, and checkout if you have one

What is included

  • A site connected to its database and working on every template
  • A short incident note naming the exact cause and what we changed
  • A table health check across the whole database, not just the broken one
  • The pre-fix backup, kept for 30 days
  • A free 9-layer scan with anything else we found

Not included

  • Recovering data from a database that is genuinely gone with no backup anywhere
  • Fixing an outage on the host side — we can only document and escalate it
  • Migrating you to a different host, which we quote separately
  • Malware removal, custom development, design or content work

Questions about this fix

Is my data lost?

Almost never. This error is about reaching the database, not about the data inside it. In most cases the data is intact and the connection is the only thing broken. If a table is corrupted we repair it, and we take a backup before attempting anything.

My host says the database is fine. What now?

Then it is usually credentials, a connection limit, or a corrupted table that only shows under specific queries. We connect directly and test rather than take either side's word for it, and the incident note tells you exactly what we found.

It works sometimes and fails other times. Is that still this?

Yes, and intermittent usually means a connection limit rather than wrong credentials. Something is opening more connections than the account allows, often a plugin polling in the background. We find what and fix it.

Can I just change the password myself?

Please do not. Changing it at the host without updating wp-config, or the other way round, is one of the most common ways this problem gets worse. It is the first thing we check and takes us minutes.

What if it turns out the host is down?

We tell you within the first response and refund in full. You should not pay us for an outage you cannot control and we cannot fix.

Error establishing database connection
$109.32 · delivered in 48 hours · needs Hosting panel, SFTP access, Database access

Related fixes

If this is the second time this year

A bad update breaking the site is a symptom of updates not being tested first. Care plans run every update on a staging clone before it reaches your live site, which is the actual fix for this happening again.

See care plans

Your access, your rules

Create a separate admin account for us and delete it when we are done. For anything else, we get in touch and agree a method — never a form field on this site, never by reply to an email.

We back up first, always

Before anything is touched we take a full backup and keep it for 30 days. If a fix goes wrong, we put the site back exactly as it was.

If it is not what you bought

If the problem turns out smaller than what you ordered, we refund the difference. If it is bigger, we stop and send a quote before doing any extra work.

If we cannot fix it

You get back what we received. Diagnosis is on us — you only pay when the problem is actually solved. The payment processor takes its fee before the money reaches us, so we never hold it and it is not ours to return. That is true here as everywhere else.

If it comes back

Reply within seven days of delivery and we put it back on the bench at no cost. The fix is not finished until it holds.

What we are responsible for

If something goes wrong with a fix, our responsibility is limited to what you paid for it. We take a full backup first so mistakes can be undone, and we tell you before doing anything outside what you bought.