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.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.