Local Environment: Windows XP system, XAMPP integrated environment.
XAMPP installation directory: D:/XAMPP
1, first stop the running MySQL process
Copy Code code as follows:
If it is not loaded as a service, it can be shut down directly in the Process Manager or service.
2. Start MySQL in safe mode
Go to the MySQL directory and run under the command line
Copy Code code as follows:
>d:
>CD Xampp/mysql/bin
>mysqld.exe--skip-grant-tables
3, after the completion of the password can not enter the MySQL
Copy Code code as follows:
When prompted to enter a password, you can return directly.
4. Change Password
Copy Code code as follows:
>use MySQL
>update user Set Password=password (' New password ') where user= ' root ';
>flush privileges;
5. Start MySQL Service
In Task Manager, close all MySQL processes and start using the following command.
Copy Code code as follows: