Win several ways to change the root password under MySQL # #win2003mysql password hack
Method 1: Use the Set password command
Mysql-u Root
mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Newpass ');
Method 2: In the case of forgetting the MySQL password
1. First turn off the MySQL service
2. Use cmd to enter the MySQL installation directory under the bin input mysqld--skip-grant-tables enter MySQL Safe Mode # Here's msqld–skip-grant-tables is mysql5.5 version and one is MYSQ Ld-nt–skip-grant-tables versions are different, the commands that go in are different. 2 commands test it.
2. Re-open a CMD command-line window directly enter mysql–uroot–p directly press ENTER to go in this time no password is required 3. Change the root password
Update Mysq.user set Password=password (' New password ') where user= "root";
4. Reload Permissions
Mysql>flush Privileges
5. Ending the Mysqd.exe process
6. Turn on MySQL service
This allows you to enter MySQL by entering a new password in the bin directory of MySQL.
Mysqlroot password hack under Windows