WordPress instance is broken: Error establishing a database connection

Created:

2017-05-12 19:44:19 UTC

Modified:

2017-08-16 16:25:39 UTC

0

Was this article helpful?


Have more questions?

Submit a request

WordPress instance is broken: Error establishing a database connection

Applicable to:

  • Plesk for Linux

Symptoms

WordPress instance is broken:

Error establishing a database connection. This either means that the username and password information in your `wp-config.php` file is incorrect or we can’t contact the database server at `127.0.0.1:3306`. This could mean your host’s database server is down 

Cause

Incorrect database connection settings in wp-config.php.

Resolution

1. go to Customer panel > Databases > User management and make sure that the correct credentials are set.

2. Set the database connection credentials and database name in configuration file /var/www/vhosts/example.com/httpdocs/wp-config.php:

define('DB_NAME', 'database-name');
define('DB_USER', 'database-username');
define('DB_PASSWORD', 'database-password');
define('DB_HOST', 'localhost');

3. Make sure that the database exists: Plesk > Tools & Settings > database Servers > MySQL > Databases

Have more questions? Submit a request
Please sign in to leave a comment.