Unable to access Plesk: Access denied for user 'admin'@'localhost' (using password: YES)

Created:

2016-11-16 12:42:31 UTC

Modified:

2017-06-27 06:30:37 UTC

12

Was this article helpful?


Have more questions?

Submit a request

Unable to access Plesk: Access denied for user 'admin'@'localhost' (using password: YES)

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

Unable to log in to Plesk. The following error is displayed instead of the login screen:

ERROR: PleskFatalException
Unable to connect to database: saved admin password is incorrect.
0: common_func.php3:93
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: auth.php3:127

OR

Access denied for user 'admin'@'localhost' (using password: YES)

Cause

  • The password in /etc/psa/.psa.shadow file (which is used to access Plesk database), does not match the admin password in MySQL database.

Or:

  • old-passwords=1 option is enabled in /etc/my.cnf (on Debian based distributions the path is /etc/mysql/my.cnf ).

Resolution

  1. Connect to the server using SSH.
  2. Make sure that the option old-passwords is not set to 1 in /etc/my.cnf file (on Debian based distributions the path is /etc/mysql/my.cnf ):

    # grep -ir old-passwords /etc/my*
    #
  3. Obtain the correct Plesk password:

    # cat /etc/psa/.psa.shadow
    $AES-128-*****************************************************
  4. Try connecting to the MySQL database and update admin password:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin mysql
    mysql> UPDATE mysql.user SET Password=PASSWORD('$AES-128-***') WHERE User='admin';

    Note: If you are unable to connect, add skip-grant-tables string in the /etc/my.cnf file (on Debian based distributions the path is /etc/mysql/my.cnf):

    # cat /etc/my.cnf
    ...
    [mysqld]
    skip-grant-tables
    ...

    restart MySQL server and update the admin password:
    # service mysqld restart (for CentOS)
    # service mysql restart (for Debian/Ubuntu)
    # mysql -uadmin mysql
    mysql> UPDATE mysql.user SET Password=PASSWORD('$AES-128-***') WHERE User='admin';

    After that, do not forget to remove skip-grant-tables and restart MySQL service.

  5. Update the password for Plesk using the ch_admin_passwd utility:

    # /usr/local/psa/bin/admin --show-password
    plesk_password
    # export PSA_PASSWORD=password
    # /usr/local/psa/admin/bin/ch_admin_passwd
Have more questions? Submit a request
Please sign in to leave a comment.