Applicable to:
- Plesk for Windows
Symptoms
-
After upgrading Plesk on Windows or after changing the admin password, the following error is shown instead of the Plesk login page:
CONFIG_TEXT: Access denied for user 'admin'@'localhost' (using password: YES)
-
A similar error appears when you are opening the PHPMyAdmin page after the issue above is resolved:
CONFIG_TEXT: You probably did not create a configuration file. You might want to use the setup script to create one.
#1045 - Access denied for user 'admin'@'localhost' (using password: YES)
Cause
An incorrect password is set for the user admin
in the MySQL database.
Resolution
-
Add the
skip-grant-tables
option under the[PleskSQLServer]
section of the file%plesk_dir%MySQL\my.ini
. -
Then, restart the Plesk SQL Server service:
C:\> net stop PleskSQLServer net start PleskSQLServer
-
Then change the admin password:
"%plesk_cli%\init_conf.exe" --set-admin-password -passwd <new_password>
-
Remove the
skip-grant-tables
and restart the service again.
-
Connect to psa database:
C:\>"%plesk_dir%\mysql\bin\mysql.exe" -uadmin -P8306 -p psa
Enter password: ***********
mysql> select * from databaseservers;
+----+-------------------+------+-------+----------------+-------------+-------------------------------------------------------+
| id | host | port | type | server_version | admin_login | admin_password |
+----+-------------------+------+-------+----------------+-------------+----------------+-------------------------------------------+
| 1 | localhost | 3306 | mysql | 5.1.68 | admin | $AES-128-CBC$dOWumr1ccMryZe7HTKh+dA$tMQ0kteqadixYOK51a2Nmg |
| 2 | .\MSSQLSERVER2008 | 0 | mssql | 10.50.1600 | sa | $AES-128-CBC$Mp/U5Dyj3Dp+u40mRnEkKA$M/EC+USxJjKfXUoXheqW2g |
+----+------------------------+------+-------+----------------+-------------+-------------------------------------------------------+ -
Temporarily remove the row which describes the MySQL instance:
MYSQL_WIN: mysql> delete from databaseservers where id=1;
Query OK, 1 row affected (0.00 sec) -
Go to Plesk > Tools and Settings > Database servers and add a
mysql
database with theadmin
username and your own password. -
Check the newly added row in the
databaseservers
table and take the value from theadmin_password
column.MYSQL_WIN: select * from databaseservers;
+----+-------------------+------+-------+----------------+-------------+------------------------------------------------------------+---------------+------------+
| id | host | port | type | server_version | admin_login | admin_password | parameters_id | last_error |
+----+-------------------+------+-------+----------------+-------------+------------------------------------------------------------+---------------+------------+
| 2 | .\MSSQLSERVER2008 | 0 | mssql | 10.50.1600 | sa | $AES-128-CBC$Mp/U5Dyj3Dp+u40mRnEkKA$M/EC+USxJjKfXUoXheqW2g | 0 | no_error |
| 5 | localhost | 3306 | mysql | 5.1.68 | admin | $AES-128-CBC$G2NUq/EH0zPCHYxJeRiY8g$Up7gweyCwXl3I613+GTcDg | 189 | no_error |
+----+-------------------+------+-------+----------------+-------------+------------------------------------------------------------+---------------+------------+ -
Revert changes in this table back to their original state and set the new password only:
MYSQL_WIN: mysql> delete from databaseservers where id=5;
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO `databaseservers` VALUES (1,'localhost','3306','mysql','5.1.68','admin','$AES-128-CBC$dOWumr1ccMryZe7HTKh+dA$tMQ0kteqadixYOK51a2Nmg',NULL,'no_error');
Query OK, 1 row affected (0.00 sec)
mysql> UPDATE databaseservers SET admin_password='$AES-128-CBC$G2NUq/EH0zPCHYxJeRiY8g$Up7gweyCwXl3I613+GTcDg' where id=1;
Query OK, 1 row affected (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 0
Comments
1 comment
Thank you very much Pavel, it's works for me! Very good!
Please sign in to leave a comment.