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
-
Connect to the Plesk server via RDP.
-
Open the MySQL configuration file:
C:\> notepad '%plesk_dir%MySQL\my.ini'
-
Add the
skip-grant-tables
option under the[PleskSQLServer]
section:CONFIG_TEXT: [PleskSQLServer]
skip-grant-tables -
Save the changes.
-
Restart the Plesk SQL Server service:
C:\> net stop PleskSQLServer && net start PleskSQLServer
-
Find the MySQL / MariaDB server version:
C:\> plesk db "SELECT VERSION();"
-
Depending on the version, change the admin password in the database:
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
C:\> plesk db "update mysql.user set authentication_string=password('new_password') where user='admin'"
-
Remove the
skip-grant-tables
from%plesk_dir%MySQL\my.ini
. -
Restart the Plesk SQL Server service:
C:\> net stop PleskSQLServer && net start PleskSQLServer
-
Update the password in Windows registry:
C:\> plesk sbin psadb --update-admin-password --password="new_password"
Comments
0 comments
Please sign in to leave a comment.