The details are as follows:
1. I forgot the password. How can I change the root password? Open the cmd window first;
2. Run dir to check the directory;
3. Switch cd mysql/bin to this directory;
4. Enter the current password to report an error;
5. mysqld -- defaults-file = "D: \ phpStudy \ MySQL \ my. ini" -- console -- skip-grant-tables run the command to bypass the authorization table;
6. Open another dos window and enter mysql to enter the mysql service;
7. The last step is show database; use mysql; update user set password = PASSWORD ('000000') where USER = 'root'; after the execution is complete, the password is successfully modified;
8. Log on again and try changing the password.
The above content is the method for modifying the root password in Windows 7. If you have the same requirements, you can try it again and I believe you will learn it soon. Hope to help you!