Reprinted from: http://blog.csdn.net/ofreelander/article/details/50802780
1.my-default.ini renamed My.ini
Copy the My-default.ini under the extracted directory and change the name to My.ini.
2. Open the Windows environment variable settings, new variable name mysql_home, the variable value is the MYSQL installation directory path, the environment variable is added in the path variable;%mysql_home%\bin;
3. Several commands
Installing the MySQL service: mysqld--install
Startup: Net start MySQL
Stop: net stop MySQL
Uninstall: SC Delete mysql,mysqld-remove
Command-line window must be opened in Administrator mode, to%mysql_home%\bin; in this directory,
A. Installation Services: Mysqld--install.
B. Start the service net start MySQL
(There may be a problem, the MySQL service is starting.) The mSQL service could not be started. The service did not report any errors. Please type NET helpmsg 3534 for more help.
Delete the Data folder and initialize the data directory with Mysqld--initialize. Delete the data, the Task Manager to open the kill mysqld process, the other start or shut down the service when the failure of the same practice. )
When successfully entering the service, use
Mysql-u Root-p Enter
Enter password
Error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
Close Service net stop MySQL
Open with Safe mode, mysqld--skip-grant-tables
At this point, the cursor will always blink. Note, do not move, open another command-line window.
4. The same operation as before came to the bin directory,
Login Mysql-u Root-p
Password is empty, direct carriage return;
We can go in.
And then
Use MySQL;
(Perhaps the previous version of the password header is password,5.7.11 is authentication_string, you can select * from user, view)
(old version) update user set Password=password ("123456") where user= "root";
(5.7.11) Update user set Authentication_string=password ("123456") where user= "root";
Finally, flush the privileges; it's OK.
5. Last login and try.
Just start to fail, is the English mysqld process is still open, kill off on the line.
Finally, the root password was successfully modified.
MySQL initial password settings under Windows