Error Establishing a Database Connection
Fix the WordPress database connection error by checking wp-config.php, database credentials, MySQL/MariaDB health, and hosting changes.
Diagnose website database errors involving WordPress, MySQL, MariaDB, credentials, server health, migrations, and connection limits.
Database errors can be credentials, hostnames, permissions, server health, connection limits, migrations, or slow queries. In WordPress, the visible message is often clear, but the root cause still needs a careful split between wp-config.php settings and the database service itself.
| Symptom | Likely issue | Next page |
|---|---|---|
| WordPress says database connection error | Credentials, DB host, or DB service unavailable | Error Establishing a Database Connection |
| Error after migration | Wrong DB name, user, password, host, or table prefix | Repair wp-config.php settings |
| Intermittent failures | MySQL/MariaDB service, connection limit, or host outage | Check MySQL or MariaDB health |
| Site shows 500 instead | PHP fatal error or app crash may be primary | WordPress 500 |
Do not expose database passwords, salts, or private hostnames in public tickets. When sending a host an escalation payload, include the site URL, timestamp and timezone, DB hostname, database name without password, recent migration/change, and whether a direct database login works from the hosting panel or shell.
Use WordPress troubleshooting when database errors appear alongside plugin, theme, cache, or PHP changes. Use the HTTP hub if the visible symptom is a 500 or 502 rather than the database connection message.
A credential problem is usually consistent: every request that needs the database fails until the name, user, password, host, or table prefix is corrected. A service-health problem can be intermittent: the site may work, then fail during traffic spikes, backups, imports, maintenance windows, or connection-limit exhaustion. That distinction decides whether to repair wp-config.php or gather server-health evidence first.
Domain:
Time and timezone:
Database host/name:
Recent migration or password change:
Does direct database login work:
Does the error affect wp-admin:
Relevant MySQL/MariaDB status or host-panel alert:
Also include whether the site is a single WordPress install, multisite, or a restored staging copy. That context helps support avoid checking the wrong database or table prefix.
Fix the WordPress database connection error by checking wp-config.php, database credentials, MySQL/MariaDB health, and hosting changes.
Troubleshoot a WordPress 502 by checking PHP-FPM, overloaded plugins, theme changes, cache/CDN layers, hosting limits, and logs.
Use a safe rollback workflow for website errors by preserving evidence, restoring the smallest change, and verifying recovery.
Check and repair WordPress database settings in wp-config.php, including database name, user, password, host, charset, and table prefix.
Verify MySQL or MariaDB service health, connection limits, credentials, database availability, and hosting status for WordPress errors.
Restore WordPress files and database carefully after a failed update, bad migration, broken plugin, or damaged wp-config.php change.
Use wp-config.php as the starting reference for database credentials, debug logging, salts, table prefixes, and environment-specific WordPress settings.