Find the answers you need

Support Database

How to fix the ‘Error Establishing Database Connection’ in WordPress

Error establishing database connection

The Error Establishing Database Connection error means that your wp-config.php file doesn’t contain valid database credentials.

Edit your wp-config.php file and you'll see the database settings section:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'SCWORDPRESS-33426930ea');

/** MySQL database username */
define('DB_USER', 'SCWORDPRESS-33426930ea');

/** MySQL database password */
define('DB_PASSWORD', 'eb07bfe05d3240-example');

/** MySQL hostname */
define('DB_HOST', 'wordpressdb-i.hosting.stackcp.net');

Ensure all four sections correspond to the database details on the 20i package via the MySQL Databases page: Manage Hosting > Choose Package > MySQL Databases.

You may wish to take the password in the wp-config.php file and set the database password to the same one to ensure it matches. 

After saving the wp-config.php file, refresh the site and the site should connect to the database successfully.