Monthly Archives: March 2013

[转]Windows Plesk I cannot connect to the MySQL database as root/admin

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> select mysql
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.