Failed to connect to database: Access denied for user 'admin'@'localhost'
When I try to configure connection to client’s MySQL server in Plesk I get an error:Failed to connect to database: Access denied for user 'admin'@'localhost'.Ho can I fix it?
This problem occurs when Plesk connection to MySQL server, which is used for clients’ databases storing, has gotten misconfigured. To configure it back you need perform the following steps:
This problem occurs when Plesk connection to MySQL server, which is used for clients’ databases storing, has gotten misconfigured. To configure it back you need perform the following steps:
- Edit MySQL configuration file my.ini located within %plesk_dir%databases\mysql\data.
- Add parameter skip-grant-tables into the [MySQLD] section.
- Restart SQL Server.
- Log into MySQL.
%plesk_dir%\mysql\bin\mysql.exe mysql - Execute the following query:
mysql> update user set password=password('current_password') where user='admin'; - Remove skip-grant-tables from within the [MySQLD] section within
%plesk_dir%\databases\mysql\data\my.ini - Restart SQL Server.
Where `current_password` is the password for admin in client’s MySQL which is stored in Plesk. It is used by Plesk to control client’s MySQL server. If you do know what is the current password you can fetch it from Plesk database using this query:
%plesk_dir%\mysql\bin\mysql -uadmin -p`pleskadmin_password` -P8306 psamysql> select val from misc where param=’mysql_admin_passwd’;
Comments