Plesk

Plesk for Windows Server shows the error: Access denied for user ‘admin’@’localhost’ (using password: YES)

Symptoms

When accessing Plesk in a web-browser or running a Plesk utility, the following error is shown:

DB query failed: SQLSTATE[HY000] [1045] Access denied for user 'admin'@'localhost' (using password: YES)

Cause

An incorrect password is set for the MySQL admin user in the MySQL database.

Resolution

  1. Connect to the Plesk server via RDP.

  2. Start a command prompt as an Administrator.

  3. Open the MySQL configuration file:

    C:> notepad '%plesk_dir%MySQLmy.ini'

  4. Add the skip-grant-tables option under the [PleskSQLServer] section:

    [PleskSQLServer]
    skip-grant-tables

  5. Save the changes.

  6. Restart the Plesk SQL Server service:

    C:> net stop PleskSQLServer && net start PleskSQLServer

  7. Find the MySQL / MariaDB server version:

    C:> plesk db "SELECT VERSION();"

  8. Depending on the version, change the admin password in the database:

 

For MySQL 5.7.6 and newer / MariaDB 10.1.21 and newer

 

C:> plesk db

use mysql;

FLUSH PRIVILEGES;

DROP USER 'admin'@'localhost';

CREATE USER 'admin'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('new_password');

GRANT ALL ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;

exit

 

For MySQL 5.7.5 and earlier / MariaDB 10.1.20 and earlier

 

C:> plesk db "update mysql.user set authentication_string=password('new_password') where user='admin'"

 

  1. Remove the skip-grant-tables from %plesk_dir%MySQLmy.ini.

  2. Restart the Plesk SQL Server service:

    C:> net stop PleskSQLServer && net start PleskSQLServer

  3. Update the password in Windows registry:

    C:> plesk sbin psadb --update-admin-password --password="new_password"

Exit mobile version