Skip to content
Get help
Home/Bug Fix Library/Error Establishing a Database Connection

WordPress Bug Fix Library

Error Establishing a Database Connection

Fix WordPress database connection errors caused by credentials, database host outages, corrupted tables, connection limits or configuration changes.

Reviewed and updated 2026-09-06

Quick answer

WordPress shows “Error establishing a database connection” when PHP cannot use the configured database connection reliably. The cause may be credentials, the database server itself, limits, corruption or environment changes.

Symptoms

  • The standard “Error establishing a database connection” page appears.
  • The error is intermittent during traffic spikes.
  • wp-admin reports that one or more database tables are unavailable or need repair.
  • The problem began after migration, password rotation or hosting changes.

Common causes

The same visible WordPress error can have several causes. A reliable fix starts by matching the symptom to logs, request behavior and recent changes.

  • Incorrect DB_NAME, DB_USER, DB_PASSWORD or DB_HOST in wp-config.php.
  • MySQL/MariaDB service outage or network connectivity issue.
  • Database user permissions changed.
  • Connection limits exhausted under load.
  • Corrupted tables or disk/storage problems.

Safe diagnosis

  1. Confirm the database server is reachable independently of WordPress.
  2. Compare wp-config.php values with the hosting database credentials without exposing them publicly.
  3. Check server status, max connections and database error logs.
  4. Inspect table health only when connection is available.

Production safety: create a recovery point before changing code, plugins, database values or server configuration. Business-critical WooCommerce sites should avoid random deactivate/update experiments during active traffic.

How the issue is fixed

  • Correct credentials or database host information.
  • Restore the database service or resolve resource exhaustion.
  • Repair affected tables after creating a verified backup.
  • Update migrated URLs/configuration only if the connection itself is healthy.

Avoid this shortcut: Do not post database credentials in screenshots, tickets or public forums. Rotate them if they were exposed.

When to request expert WordPress bug fixing

Professional troubleshooting is useful when the site is business-critical, the error returns after a temporary fix, wp-admin is unavailable, the failure began after a complex update/migration, or you cannot identify the responsible code from logs. WP•FIX focuses on the smallest safe change that restores the failing path and explains the root cause.

FAQ

Does this mean my database was deleted?

Not necessarily. Most connection errors happen because WordPress cannot connect, even though the database still exists.

Can high traffic cause this error?

Yes. Connection limits or database overload can make the problem intermittent.

Why did it happen after migration?

The new host may use different database credentials, hostnames, ports or permissions.

Can a hacked site show this error?

It can, but this message alone is not evidence of malware. Configuration and server health should be checked first.

Need this WordPress issue fixed?

Send the URL, error message and what changed immediately before the problem started.

Request troubleshooting

Professional WordPress troubleshooting

Need this issue fixed on a live site?

Send the site URL, exact symptom and what changed before the problem started. The dedicated bug-fix intake keeps technical repair requests separate from malware incidents.

Do not send passwords or hosting credentials in the form. Access is requested separately only if needed.

Your next step

Tell us what
needs attention.

Start with the site URL and what you are seeing. The WP Fix team will review the details and reply by email.

  1. We clarify the issue and the outcome you need.
  2. We confirm scope, availability and price.
  3. We agree on access and the work before making changes.

No passwords needed to start. Timing depends on the issue and current availability.

About: Error Establishing a Database Connection

Please do not include passwords or access keys. We use your details to respond to this enquiry. Web3Forms processes the submission.