Frequently Asked QuestionsApps

When I access my WordPress site, I receive the error: Error establishing a database connection. What can I do?

The error "Error establishing a database connection" in WordPress can be caused by incorrect authentication data or exhaustion of hosting resources. Check wp-config.php and optimize the application.

1
Views 867Updated 2 luniPublished on 26/07/2018by Sebastian Szlivka

This error message indicates that the WordPress application cannot connect to the database server. The causes can be various, but the most common are as follows:

1. Incorrect authentication data in the wp-config.php file

Check and ensure that the information in the wp-config.php file is correct. The key fields that need to be validated are:

  • define('DB_NAME', 'Database Name');
  • define('DB_USER', 'Database User');
  • define('DB_PASSWORD', 'User password');
  • define('DB_HOST', 'localhost');

These data must exactly match those set in the hosting control panel.

2. Exhaustion of resources allocated to the hosting package

Another common cause is the excessive use of resources allocated to the hosting package. This can occur due to increased traffic or inefficient configuration of the WordPress application.

Resolution:

  • Optimize the WordPress application to reduce resource consumption. You can find useful information by accessing the guide: Optimization Recommendations.
  • If optimization is not sufficient, consider upgrading to a higher hosting package that offers more resources.