Skip to main contentমূল বিষয়বস্তুতে যান

WordPress

WordPress: Error establishing a database connection

‘Error establishing a database connection’ means WordPress could not connect to its configured database. The cause may be a stopped MySQL or MariaDB service, changed connection settings or a hosting limit. Check whether other sites are affected and note recent changes before resetting credentials or considering a backup restore.

Common error messages
Error establishing a database connection
Check the symptoms
MD Mahe Alam Leon, Founder & Lead Engineer, Hostaccent

Technical support led by MD Mahe Alam LeonFounder & Lead Engineer, Hostaccent · 15 years of hands-on server and hosting work · Content checked

About Hostaccent

Are you seeing this?

  • WordPress shows the connection error at the homepage, in wp-admin or both.
  • A cached page loads, while login or other pages that use the database fail.
  • The issue starts after a migration, database password change or server incident.

What usually causes it?

  1. The database service is unreachable

    A service outage, restart or network issue can prevent WordPress from reaching MySQL or MariaDB.

  2. Connection details changed

    After a move or account change, the database host, name, user or password may differ from the settings in WordPress.

  3. The database user cannot connect

    A user may have lost permission or reached its connection limit. A server or account under load can also reject new connections.

Safe checks you can do yourself

  • Compare the public site and wp-admin

    Open each once and record which fails. A cached homepage can still load while WordPress requests that reach the database fail.

  • Read hosting status and existing logs

    Look for a database incident, connection refusal, authentication failure or quota warning near the same time.

  • Check the timeline

    Note any migration, password rotation or restore. If you already have control-panel access, compare the database name and user with your records without editing them.

When to stop and get an expert

  • Orders or account updates may have been written since the last verified backup.
  • Several sites on one host are affected, or the message follows a server crash.
  • You would need to reset a shared database password, change privileges or restore a live database to keep troubleshooting.
Get Expert Help

How we fix it

  1. Trace the failing connection

    After written authorisation, we check the WordPress configuration, database service and relevant logs with read-only access where possible.

  2. Preserve data and approve the repair

    We confirm the recovery point and agree the proposed connection, permission or service change before applying it.

  3. Test uncached pages and workflows

    We verify the front end and wp-admin and, where relevant, agree tests for account, cart and checkout paths.

Fixed-price diagnostic

From US$49

We confirm the exact diagnostic fee for one defined issue before you approve it. You receive written findings and a proposed next step. Any repair is quoted and approved separately. There are no automatic charges or hidden fees.

What you receive
A written diagnosis identifying the failing connection layer, the proposed repair and which WordPress workflows need to be verified.
Turnaround
We confirm the diagnostic window once the affected site and access are known. Host-side work may depend on the provider’s availability.

Frequently asked questions

Does this mean my posts or orders are gone?

The message says WordPress cannot connect. The records may still be intact. Check database availability and backup status before considering any restore.

Why does the homepage still load?

Your cache or CDN may serve a stored copy while WordPress cannot query its database. Check an uncached path such as the login screen.

Can the error come and go under load?

Yes. A saturated database or a connection limit can reject requests at busy times. Match the timing to resource usage and database logs.

Why did it start after a migration?

The new host may use a different database hostname or account prefix, or the database user may lack access. Compare the host’s records with the settings used by the site.

Should I restore my backup?

Check the failure and confirm what a restore would overwrite first. A production restore can discard orders, edits or account changes made since the backup.

Technical references

Request a diagnostic

Tell us what you saw, when it started and what was affected. An error excerpt with sensitive details removed is enough to start.

Get Expert Help