Plesk upgrade/installation fails: Access denied for user 'admin'@'localhost'

Created:

2016-11-16 12:59:41 UTC

Modified:

2017-04-24 11:16:23 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk upgrade/installation fails: Access denied for user 'admin'@'localhost'

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk Onyx for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 9.x and below for Linux

Symptoms

  1. Plesk upgrade or installation fails with one of the following errors in /tmp/autoinstaller3.log :

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

    OR

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

    OR

    Access denied for user 'pp_sb_db'@'localhost' (using password: yes)
    
  2. Attempt to connect to Plesk database fails:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa
    ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
  3. There is a /root/.my.cnf file on the server containing invalid credentials:

    # cat /root/.my.cnf
    [client]
    user=root
    password=mypassword

Cause

Invalid MySQL credentials. Additional MySQL configuration files are included.

Resolution

MySQL reads startup options (including credentials, if defined) from the following files, in the below order:

/etc/my.cnf
/etc/mysql/my.cnf
SYSCONFDIR/my.cnf
$MYSQL_HOME/my.cnf
defaults-extra-file (The file specified with --defaults-extra-file=path, if any)
~/.my.cnf

Plesk uses the environment variable to pass the password to MySQL server, but .my.cnf file has a greater priority and MySQL uses the password from this file.

Make sure there is no additional MySQL configuration files like /root/.my.cnf with MySQL password.

Since MySQL 5.0.4, it is possible to use !include directives in option files to include other option files and !includedir to search specific directories for option files. For example, to include the /home/mydir/myopt.cnf file use the following directive:

!include /home/mydir/myopt.cnf

If there is an !include directive make sure it does not refer to invalid credentials.

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