Recently has been useless mysql,root password to forget, and then I modified it, and now tidy up the steps. (my version is 5.1)
1. First get the MySQL bin path, copy it down.
Right-click and select Properties.
2. Open the Command Window "CMD" and switch the path to the MySQL path just copied;
>>CD C:\Program files\mysql\mysql Server 5.1\bin
Close the SQL service;
>>net stop MySQL
Then enter: >> mysqld--skip-grant-tables
3. At this point, you should open another command window, the same switch to the MySQL path;
Input: >>mysql-uroot-p Press 2 times to enter;
Then, modify the password:>> update mysql.user set Password=password ('123456') where user= ' root ';
(123456) It's your new password.
Finally enter flush privileges; Will remind SQL to refresh the system permissions, the password will take effect.
OK, the root password has been modified.
Modify the root password of MySQL under Windows environment