Win7 mysql server forgot password solution

  

When using the windows7 system, I encountered a wrong password on the mysql server. What is going on? How do we change the default password for root? In order to help everyone better use win7 system, the following small series will give you the specific method of changing the root password of windows7 system. Let's go and have a look!

The details are as follows:

1, the password is forgotten, how to modify the root password, first open the cmd window;

2, dir check this directory has What directory;

3, cd mysql/bin switch to this directory;

4, enter the current password prompt error;

5, mysqld --defaults-file="D:\\phpStudy\\MySQL\\my.ini" --console --skip-grant-tables Execute the command to bypass the authorization table;

6, another reopen a dos window, directly enter mysql to enter the mysql service;

7, the last step show database; use mysql; update user set password=PASSWORD(‘12345’ Where USER=‘root’; After the completion of the password, the password is successfully modified;

8, log in again, try the password after modification.

The above content is a small series for everyone to change the root password under the windows7 system. If you have the same needs, you can try it out and believe that you will learn soon. I hope it will help everyone!

Copyright © Windows knowledge All Rights Reserved