How to change the password in mysql 5.7.20: First log in to the system as the system administrator; then open cmd; finally change the password through the "update user set authentication_string=password('123456') ..." command. Can.
Recommended: "mysql video tutorial"
mysql 5.7.20 Change the root password.
1. Log in to the system as a system administrator.
2. Open cmd
Check whether mysql is started. net start mysql
If you start it, stop it. Net stop mysql
3. Skip the permission check and start mysql. Click the bin directory in mysql, then hold down the shift right key, and then select open command window
Paste in mysqld-nt --skip-grant-tables
4. User login mysql -uroot -p
Select database use mysql;
5 . The password field in the mysql5.7 version is not password, so we enter the following sentence to reset the password
update user set authentication_string=password('123456') where user='root';
6. Refresh flush privileges;
7. Exit quit; and restart the service.
The above is the detailed content of mysql 5.7.20 How to change password. For more information, please follow other related articles on the PHP Chinese website!