Plesk

Unable to access MySQL/MariaDB databases on Plesk for Windows: Access denied for user ‘admin’@’localhost’ (using password: YES)

Applicable to:

  • Plesk for Windows

Symptoms

Cause

Plesk stores an incorrect MySQL/MariaDB server administrator password.

Resolution

Reconnect Plesk to the MySQL/MariaDB server:

  1. Connect to the server using RDP

  2. Edit the MySQL/MariaDB configuration file %plesk_dir%DatabasesMySQLmy.ini and add the line skip-grant-tables to the [mysqld] section and save it using text editor:

    [mysqld]
    skip-grant-tables

  3. Restart the MySQL/MariaDB server (but not "Plesk SQL Server"), running on port 3306 using the Plesk Services Monitor, which can be started from the Windows Start menu.

    Note: Plesk Services Monitor could also be started using the next cmd.exe command:

    C:> "%plesk_dir%adminbintraymonitor.exe"

  4. Log into MySQL/MariaDB without the password:

    "%plesk_dir%MySQLbinmysql.exe" -P3306

  5. Reload the grant-tables policies by running the next command:

    FLUSH PRIVILEGES;

  6. Update/recreate the user by specifying a new password using the next command:

    C:> grant all privileges on *.* to 'admin'@'localhost' identified by 'new_password' with grant option;

    Note: Make sure to replace 'new_password' with a new password of choice:

  7. Tell the database server to reload the grant tables by issuing the FLUSH PRIVILEGES command;

    FLUSH PRIVILEGES;

  8. Remove the skip-grant-tables from the MySQL/MariaDB configuration file(%plesk_dir%DatabasesMySQLmy.ini) and restart the service again as in Step 3.

  9. Log in to the Plesk interface, go to the database server management settings ( Tools & Settings > Database Servers ) and open the server's settings:

  10. On the opened page click the "Settings" button and specify new the password that was set in Step 6:


Exit mobile version