1, close the MySQL database you are currently running, either by ending the MySQL process or by directly shutting down the MySQL server
2, close the database, run click to start running, enter cmd into the command Line window, in this command line to enter your database installation path, the general default installation will be in C:Program filesmysqlmysql Server 5.0bin
3, enter mysqld--skip-grant-tables in this path and then return, this command means to start the database from Safe mode
4, as long as the above steps succeed, this CMD window will always have a small cursor appears, and then there is no hint to bounce out, this means that your database has been started, this time to reopen a CMD window, the same access to the MySQL database installation path, and then enter MYSQL-UROOT-P , this command means to use a blank password to log in to MySQL, the success of the words will see a mysql> such a hint, and finally at this prompt input update mysql.user set Password=password (' New password ') where user= ' root ';
, enter the password you want to change in the new password, then turn off all the cmd windows, turn off your server in the first step, and then run your server again in the normal steps, at which point your root password will be changed to the new password you just set.