Relaxby Yumea

WordPress error

"Error establishing a database connection"

This message means WordPress can no longer reach its database, where your content is stored. The site becomes unreachable, but the data is almost always intact.

Want us to handle it?

Free diagnosis: we tell you if it can be fixed and how much, before doing anything.

The symptoms

  • The site shows "Error establishing a database connection".
  • Both the site and the admin are unreachable.
  • Sometimes WordPress offers to repair the database.

The likely causes

  • The database credentials in wp-config.php are wrong (after a migration or a host change).
  • The database server is down or overloaded.
  • The database is corrupted.
  • The hosting quota is reached (too many connections, disk full).
  • An attack or a traffic spike saturated the server.

What you can try yourself

1

Check the credentials in wp-config.php

Database name, user, password and host must match those from your host. A recent migration is often the cause.

2

Ask your host if the database is up

The MySQL server may be temporarily unavailable or overloaded on the host's side.

3

Try repairing the database

Add define('WP_ALLOW_REPAIR', true); to wp-config.php, then open /wp-admin/maint/repair.php. Remove the line afterwards.

4

Check disk space and quotas

A full hosting plan stops the database from working. Your host's panel shows it.

5

Check whether the site was attacked

An abnormal spike of connections can saturate the database. The host's logs help decide.

When to call a professional

If the credentials are right and the database stays unreachable, if the repair fails, or if you suspect corruption or an attack: a professional diagnoses the real cause, restores the database from a clean backup if needed, and secures it against a repeat, without risking making the corruption worse.

Frequently asked questions

Is my data lost with this error?

Rarely. Most often the database still exists and the problem is a wrong credential or an unavailable server. A recent backup is still the best insurance before any change.

Where are the WordPress database credentials?

In the wp-config.php file at the site root (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST). They must exactly match those provided by your host.

Why did the error appear after a migration?

Because the database name, user or host often change from one host to another. You need to update wp-config.php with the new credentials.

We look at your site.

If we can recover it, we send you a clear price and a payment link. If we cannot, we tell you plainly, we charge nothing for that, and we can offer you a brand new site. Either way, you are never stuck.

The first look is free.

Describe my problem

Other common problems