If you forget the MySQL database password, then follow the old driver!
The first step
To close a running MySQL server process
Part II
Open the DOS window and go to the Mysql\bin directory
Part III
Enter mysqld--skip-grant-tables Press Enter//--skip-grant-tables The meaning is to start the MySQL service when the Skip Permission table authentication Skip Password Authentication!
Part Fourth
Open a DOS window again (because the DOS window is no longer in use), go to the Mysql\bin directory
Fifth Step
Enter MySQL return and if successful, a MySQL prompt will appear >
Part Sixth
Connection rights database: use MySQL;
Part seventh
Change Password: Update user set Password=password ("root") where user= "root";
mysql5.7 above version--UPDATE user SET Authentication_string=password ("root") WHERE user= "root";
Eighth step
Refresh permissions (required steps): Flush privileges;
Nineth Step
Quit quit.
One final step
Log out of the system, and then enter, using the username root and the new password just set to 123 login.
Tip If the sixth is unsuccessful, the password cannot be changed! But if the first five are successful, you're ready to access the database.
Password is a good thing, as you forget the password, password is a very old fire thing, just like the database password forgotten after the same.