Plesk

An Email Notification from WP Toolkit is received: Failed to reset cache for the instance: Error establishing a database connection.

Symptoms

Cause

Unsupported/customized database connection string set in the wp-config.php file prevent WP Toolkit from reading the data.
Every WordPress database connection string must be in the form of PHP define. Other methods like arrays and variables, are not supported.

Resolution

  1. Log into Plesk.

  2. Go to Domains > example.com > File Manager

  3. Open the wp-config.php file.

  4. Make sure the Database details such as DB_NAME, DB_HOST and user credentials are set with the default method of PHP define. e.g:

    define( 'DB_NAME', 'wp_dbnameexample' );
    define( 'DB_USER', 'wp_userexample' );
    define( 'DB_PASSWORD', 'pa$$w0rdExampl3!' );
    define( 'DB_HOST', 'localhost:3306' );
    define( 'DB_CHARSET', 'utf8' );
    define( 'DB_COLLATE', '' );

Correct the database connection details from SSH

  1. Connect to the server via SSH;

  2. Navigate to the WordPress directory usually at the domain root path:

    # cd /var/www/vhost/example.com/httpdocs

  3. Edit the WordPress wp-config.php file. Vi editor can be used for this:

    # vi wp-config.php

  4. Make sure the Database details such as DB_NAME, DB_HOST and user credentials are set with the default method of PHP define. e.g:

    define( 'DB_NAME', 'wp_dbnameexample' );
    define( 'DB_USER', 'wp_userexample' );
    define( 'DB_PASSWORD', 'pa$$w0rdExampl3!' );
    define( 'DB_HOST', 'localhost:3306' );
    define( 'DB_CHARSET', 'utf8' );
    define( 'DB_COLLATE', '' );

Exit mobile version