Plesk

After restoring server-wide backup WordPress website show error: Error establishing a database connection

Symptoms

Cause

The password was re-generated for the database and needs to be updated in the config file of the WordPress instance.

Resolution

  1. Connect to the server via SSH

  2. Find the warnings like below example in the restoration deployer.log file:

    INFO: (Restore hosting object 'example.com') The password was generated for user 'database_user'. New password is 'XXXX'

  3. For security measures back up the wp-config.php file in the document root directory of the affected domain:

    # cp -a /var/www/vhosts/example.com/httpdocs/wp-config.php{,.back}

  4. Open the file /var/www/vhosts/example.com/httpdocs/wp-config.php and replace the password on define( 'DB_PASSWORD', 'XXXX' ); line for the new one found on step 2.

Exit mobile version