WordPress

Fix WordPress Database Connection Error

Resolve "Error establishing a database connection" and get your site back online.

The Problem

This error means WordPress can't reach its database at all — wrong credentials, a crashed database service, or a corrupted database are the usual causes, and the site is completely down until it's fixed.

About this problem

WordPress shows this message when PHP cannot open a connection to MySQL or MariaDB with the details in wp-config.php. The usual causes are changed or wrong credentials, a wrong host name, a database service that has crashed or run out of resources, a full disk, or corrupted tables. After a migration it is almost always a credentials or host mismatch.

People usually come looking for this when the whole site suddenly goes offline with only this plain message, often after a server restart, a host change or a traffic spike. It can also be intermittent, appearing under load.

What's Included

What's NOT Included

How It Works

  1. I compare the database name, user, password and host in wp-config.php with the real values on the server and test a direct login with them.
  2. I check whether the database service is running and look at its error log for crashes or resource problems.
  3. I check disk space and the connection limits that might prevent new connections.
  4. If tables are reported as corrupt, I take a backup and use WordPress's repair mode or a table repair to fix them.
  5. I correct the configuration or service issue found and confirm the connection works from PHP.
  6. I load the site and admin, and check that posts, users and settings are intact.

In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.

Frequently Asked Questions

What does Error establishing a database connection mean?
WordPress cannot talk to its database. The reason is usually wrong credentials, a stopped database service or corrupted tables.
Is my data lost?
In most cases no, since the data is still in the database but unreachable. If the database itself has been deleted, that is a separate recovery issue.
Why does it appear only sometimes?
Often due to resource limits, too many connections or a database service under load. I check the server logs to see whether that is the case.
Can you fix it if my host is down?
No, hosting outages are outside my control. I can show you whether the cause is on the hosting side.
Do you manage the database server generally?
Only as it concerns this one site. Wider database server administration is a separate service.
What access do you need?
Normally the file manager or SSH to the site and database credentials or panel access.
Please note: the price shown applies to a standard case matching the description above. Every situation is different, and if your request falls outside the normal scope of this service, I will explain this before doing any additional chargeable work. I will never silently turn a small job into an expensive project.
Running into an issue with a service you've already bought, or unsure which one fits your problem? Message me directly on WhatsApp — no ticket system, no bot.