Today on the computer installed mysql5.7.16 (compressed package), after initializing the data folder, do not remember the password, DOS box does not show, no way, in order to learn how to change the password, in the Internet to find a lot of ways to solve, the final solution, the following look at the specific operation of this method:
1. Close the running MySQL service.
2. Open the DOS window and go to the Mysql\bin directory
3. Enter Mysqld--skip-grant-tables return
--skip-grant-tables means skipping permission table authentication when starting the MySQL service.
4. Open a DOS window again (because the DOS window is no longer moving), go to the Mysql\bin directory.
5. Enter MySQL return and, if successful, the MySQL prompt > will appear.
6. Connection rights database: use MySQL; (Don't forget the last semicolon).
7. Change Password: Update user set Password=password ("123") where user= "root"; (Don't forget the last semicolon).
If the change password appears
**mysql Change Password error 1054 (42S22) * *
Then use Mysql>update mysql.user set Authentication_string=password (' 123456 ') where user= ' root ' and Host = ' localhost '; Through the above modification, the root password has been modified successfully, at this time if you start the MySQL service, the service should not start, my way is to start the new computer, the new start service, the MySQL service can start normally, at this time through the Navicat can be connected with a new password, or through MySQL command line to enter the database.
MySQL 5.7.16 forgot root password How to change root password