Method, teach you two strokes to reset the root password!
1. Use mysqladmin to modify the MySQL password
c:\>mysqladmin-udbuser-p password newpass
Enter password:oldpass
Of course, the premise of using this command is that you add MySQL to the environment variable, if you do not add environment variables, it can only be in the command line CD to the mysqladmin in the
directory with this command!
2. Reset the root password
method one:
in the My.ini [mysqld] field join:
skip-grant-tables
Restart the MySQL service when MySQL does not require a password to log on to the database
Then go to MySQL
mysql>use MySQL;
Mysql>update user Set Password=password (' New password ') whereuser= ' root ';
Mysql>flush privileges; After the
is run, remove the skip-grant-tables from the My.ini and restart the mysqld.
Modify MySQL Password method two:
Do not use the method of modifying the My.ini restart Service, through the non-service mode plus skip-grant-tables run MySQL to modify the MySQL password
Stop MySQL service
Open a command-line window, Start with Mysqld-nt.exe in the bin directory, i.e. execute in command-line window: Mysqld-nt--skip-grant-tables
Then open a command-line window and log in to MySQL without entering the MySQL password.
After the password is modified as above, close the command line to run MySQL window, this time the MySQL is turned off, if you find that MySQL is still running can end
off the corresponding process to shut down.
Start the MySQL service