If you forget the mysql password, there is almost no good way to directly change the password, but we can go to my. in ini, add skip-grant-tables, and restart mysql without the password. Then, modify the root password, and delete and restart skip-grant-tables.
First of all, it is a great honor for you to find this article...
If you forget the mysql password, try the following method.
1. Open my. ini
The Code is as follows: |
Copy code |
[Mysqld] Port = 3306 # Skip-grant-tables |
Add skip-grant-tables at the end
2. Restart the mysqlservice and enter the console (mysql.exe is the fastest in the bindirectory directory)
Enter Password: Press Enter to Enter
3. Use the command to change the password
The Code is as follows: |
Copy code |
Use mysql; Update user set password = password ('000000') where user = 'root '; |
That's good. The modification is complete!
Remember to comment out the added "skip-grant-tables" in my. ini after the modification...