"ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)" when performing any changes in Plesk or in database directly

Refers to:

  • Plesk for Linux
  • MG:7a418268023388b6e5fcba37af202809
  • MT:1751d5edcca5340f78144a4499e8c1d5
  • MG:e1f748d9dfa9cd906a7daecc3aa23bc9
  • MT:6c72e63f0a012ab8a7a32cacac9c9d4f
  • MT:8528b8f99a9ed1e218de69ded6869597
  • MT:db0c591436702b667d6847f6cf00e151
  • MT:f8b9e8444a93ca26e35e7b679159db05
  • MT:5e19cea4bef05f4ac5db995a142f071f
  • MT:63889dd7a3385371f834d62a69331204
  • MG:a5b8613bbf4f2dc86ee8fae693cfc0e5
  • MG:21f435811c38807fbd397cf21b0ac937

Created:

2016-11-16 12:52:25 UTC

Modified:

2017-02-23 10:56:54 UTC

4

Was this article helpful?


Have more questions?

Submit a request

"ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)" when performing any changes in Plesk or in database directly

Symptoms

Access to Plesk and database is possible, but the following errors occur:

  1. When performing any changes in Plesk or the Plesk database:

    ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
  2. When performing a Plesk upgrade:

    MySQL databases are dumped to /var/lib/psa/dumps/mysql.preupgrade.9.5.4-11.0.9.20130807.dump.gz. ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)

Cause

A reinstalled or broken MySQL server.

Resolution

For Windows see article 213388329 "ERROR PleskMainDBException Access denied for user 'admin'@'localhost' (using password: YES)"

  1. Make sure that the password for the admin user is set correctly using the following article for Linux: 213927525 "How to retrieve Plesk admin password on Linux"
  2. Make sure that the admin user has all privileges:

  3. Log into MySQL server under 'root':

         # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin mysql
  4. Check admin privileges:

        mysql> SHOW GRANTS FOR 'admin'@'localhost'\G
  5. Grant all privileges to admin if required:

        GRANT ALL ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
  6. If the steps above will not help, or the previous command fails with an error, check /var/log/mysqld.log

If you see a message such as:

[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it

this probably means that MySQL was reinstalled or was not upgraded completely. Run the following command to update MySQL:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
Have more questions? Submit a request
Please sign in to leave a comment.