Articles in this section

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

Plesk for Windows kb: technical ABT: Group B

Applicable to:

  • Plesk for Windows

Symptoms

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

PLESK_INFO: 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%MySQL\my.ini'

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

    CONFIG_TEXT: [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

MYSQL_WIN: use mysql;

MYSQL_WIN: FLUSH PRIVILEGES;

MYSQL_WIN: DROP USER 'admin'@'localhost';

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

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

MYSQL_WIN: 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%MySQL\my.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"

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.