What should I do if I forget the mysql password?
Two times I forgot my mysql password? At first, I did the most silly thing and uninstalled the reinstallation.
Now there is a way to set the password back without uninstalling it. The knowledge comes from the internet. I will try it out here. If you have the same friends, try it.
The implementation is completed on windows.
Step 1
Find mysqld.exe in the task manager and end the process.
Step 2
Find the bin directory under the mysql installation directory, my C: \ Program Files \ MySQL \ mysql-5.6.24 \ bin
Open the console in this directory and enter mysqld -- skip-grant-tables.
Step 3
Switch to the current path and open a new controller.
1) input: mysql
2) input: show databases;
3) input: use mysql
4) input: show tables;
The user table is displayed.
Input: select user, password, host from user; to view the content in the table.
Now we can modify the data in the table through update.
Input: update user set password = passwrod ("123456") where user = "root" and host = "localhost ";
Since then, the mysql password has been changed.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.