Original: MySql5.7.11 for Windows installation (ii)
After installation, first create the Data folder (the old version would have been), the administrator open CMD,CD to the Bin folder, enter
The Mysqld–initialize-insecure–user=mysql,data folder is happily generated.
After the installation after exiting, log in again, when you encounter the password to enter, there will be an error
This is equivalent to forgetting the root password
-Shut down service net stop MySQL
- We add a line of code to the My.ini and add it under [mysqld]:
Skip-grant-tables
The Grant-tables, authorization form is not started when MySQL is started. This way we can skip the steps to enter the password, which can also be used when we forget the administrator password.
Change Password
- Start the service
- Input MySQL has skipped password input at this time
Enter use MySQL, and then enter:
Update Mysql.user set Authentication_string=password (' 123 ') where user= ' root ' and Host = ' localhost ';
Note: The new version of the MySQL database in the user table has no password field, so it can not be modified by the original way to modify the password!!!
Then enter the flush privileges;
- then quit;
- Turn off the service and put the comments out of the My.ini skip-grant-tables
- Test
- Open service
- Input Mysql-u Root-p
- Enter password
- Success
MySql5.7.11 for Windows installation (ii)