Windows Plesk I cannot connect to the MySQL database as root/admin
Solution Regretfully, MySQL is pre-installed by Plesk without the old-passwords functionality set true.
But the Plesk installer populates the admin user with a password encrypted in the old style!
To fix this you will need to enter your server with Remote Desktop and edit the follwoing file:
C:\SWSoft\Plesk\Databases\MySQL\Data\my.ini
There is a section in that file [mysqld]
Under the line starting "[mysqld]" add the following line:
old_passwords=1
so it looks like this:
[mysqld]
old_passwords=1
Now restart the MySQL service in the services manager.
You should now be able to manage MySQL with the user "admin" and the password is the same as your Plesk login. In some cases the password may still be set to the original password which is "setup".
If you still cannot log into the MySQL server then you will need to start the MySQL server with skip-grant-tables enabled.
Stop the MySQL service in the services manager.
Edit the my.ini file:
C:\SWSoft\Plesk\Databases\MySQL\Data\my.ini
Add "skip-grant-tables" to the [mysqld] section like so:
[mysqld]
old_passwords=1
skip-grant-tables
Now restart the MySQL service.
Now log into MySQL with the following command:
C:\SWSoft\Plesk\Databases\MySQL\bin\mysql "mysql"
At the MySQL prompt set the admin password:
mysql> update user set password=password('new_password') where user='admin';
Where "new_password" is the password of the PLESK admin login.
type "exit" at the MySQL prompt and then edit the my.ini file again and remove the line: skip-grant-tables
Now restart the MySQL service.
Your MySQL admin password has now been re-set.
Thank you, thank you, thank you, thank you. You saved my life.
ReplyDeleteWhy on earth my hosting company isn't aware of this issue is beyond me, but it is critical for any server admin to be able to connect as admin.
Until I found your page I spent six hours banging my head against my desk.