Database Connection Failed: Causes and Solutions
The error message "Error Establishing a Database Connection" is one of the most common issues in WordPress. It simply means that WordPress cannot access the database where all your content (texts, settings, passwords) is stored.
1. The Most Common Causes
Most of the time, the problem lies in one of the following three areas:
- Incorrect credentials: The username or password in the configuration file has been changed.
- Corrupted database: The table structure contains errors (e.g., after a crashed plugin update).
- Server overload: The database server is not responding fast enough due to high traffic or load.
2. Step-by-Step Solution
Open the
wp-config.php file via the cPanel File Manager. Compare the following lines with the data under "MySQL Databases" in cPanel:
DB_NAME(Database Name)DB_USER(Username)DB_PASSWORD(Password)DB_HOST(Should almost always be 'localhost' with CURIAWEB)
If the credentials are correct, the database might be corrupted. Add the following line to your
wp-config.php file (just before the line "That's all, stop editing"):
define('WP_ALLOW_REPAIR', true);
YourDomain.ch/wp-admin/maint/repair.php and click on "Repair Database". Important: Delete this line from the file immediately after the repair is complete!
We will bring your database back online
Have you checked the credentials and the repair didn't help? Our support team has direct access to the database servers and will assist you immediately.
Open support ticket for database check