Quick Diagnosis
Separate credential problems from database-service problems before changing configuration.
Problem
Work through the WordPress database connection error by checking credentials, database availability, host configuration, and recent migrations without editing data blindly.
Problem, cause, fix, verify
Problem
WordPress cannot connect to the configured database server with the current settings.
Audience
Administrators seeing the WordPress database connection error on public or admin pages.
First check
Separate credential problems from database-service problems before changing configuration.
Verify
When WooCommerce, memberships, or forms are active, verify recent orders and submissions after recovery. Connection fixes should not silently switch the site to an older database snapshot.
Editorial trust
On this page
Symptom
For: Administrators seeing the WordPress database connection error on public or admin pages.
Diagnosis
Separate credential problems from database-service problems before changing configuration.
Do not run repair SQL or change passwords until you know which connection detail failed.
After a migration, compare database name, user, password, host, table prefix, and DNS timing. A copied file can point production at the old database or staging at the live database.
When WooCommerce, memberships, or forms are active, verify recent orders and submissions after recovery. Connection fixes should not silently switch the site to an older database snapshot.
Diagnosis
Contact hosting support when credentials are correct but the database host rejects connections or the service is down.
References