← All articles
AFTERWORKS ARTICLES

Why Does WordPress Say Error Establishing a Database Connection?

Investigate WordPress database connection errors with a safe host handover, keeping credentials private and avoiding destructive repair attempts.

By afterworks.space3 min read
A restaurant host checks a speaking tube leading through a wall to a storekeeper, in a layered paper interior.

Part of our guide: What WordPress Maintenance Does a Small Business Website Need?

“Error establishing a database connection” means WordPress cannot connect successfully to the database it expects to use. It does not mean your pages have definitely been deleted, and it does not establish that the password is the only problem.

The database contains important site information. Treat attempts to repair or replace it as controlled maintenance, not a quick experiment.

Record the timing and scope

Note when the error began, whether it is constant or intermittent, and which pages show it. Record any recent hosting move, credential change, update or restore.

Check whether the public site and dashboard fail in the same way. A cached public page can still appear while database-dependent functions are broken, so do not assume a visible homepage proves the connection is healthy.

Avoid repeated submissions to booking or payment forms while the outcome is uncertain.

Ask the host to check availability first

The WordPress common-errors handbook identifies database configuration and hosting problems among the investigation areas.

Ask the host whether the database service is available to the website at the recorded time. Include the exact error, but do not send database passwords in an ordinary email or public support post.

If the failure is intermittent, provide several timestamps. That helps support distinguish a persistent configuration mismatch from a service that fails only under certain conditions.

Check configuration through the authorised maintainer

The maintainer may need to compare the configured database host, database name and user permissions with the provider’s actual settings. They should do this through the agreed secure access route.

Do not copy credentials from an unrelated tutorial. Do not create a new empty database and point the website at it merely to remove the error screen. A successful connection to the wrong database is not recovery.

The website ownership guide helps establish who should control these accounts before an incident occurs.

Use a non-destructive incident record

Evidence What to include
First observed failure Date, time and timezone
Affected functions Public pages, dashboard, bookings or forms
Recent changes Hosting, configuration or restore events
Provider checks Availability and relevant error evidence
Recovery point Backup date and newer business activity

This is a proposed handover format. Store sensitive technical details in the approved private system, not in a public article or shared screenshot.

For an illustrative booking site, today’s appointments may be more important than recovering an old visual design. Establish that data requirement before approving restoration.

Be cautious with repair and restore tools

A database repair operation changes data. A restore can replace current records with older ones. Both require a clear reason, recoverable copies and someone competent to judge the result.

The backup and recovery guide explains the need to consider files, database and changes since the recovery point.

If a support provider proposes a destructive step, ask what it will alter, what copy exists and how the business records will be protected. Uncertainty is a reason to clarify the plan, not to click through warnings.

Verify the real service after recovery

Check the public page, dashboard and important business action. Confirm that recent content and expected records are present.

Then record the identified cause, corrective action and prevention work in the WordPress maintenance checklist.

If the underlying cause was not established, keep that limitation visible. A website that briefly reconnects is useful evidence of recovery, but not proof that a recurring capacity or configuration problem has been resolved.

Thinking about your own rebuild?

Tell us about your business, your current website and what you would like to improve. We will help you work out the next step.

  • WordPress
  • Small business
AFTERWORKS ARTICLES
All articles ↗
3 min read

What Can I Do If I Cannot Log In to WordPress?

Recover legitimate WordPress access by identifying the login failure, using approved reset routes and keeping account recovery separate from a site outage.

  • WordPress
  • Small business

Thinking about your own website?

Explore our website rebuilds and pricing and ownership. If we have already contacted you, our preview guide explains why and what happens next.