In windows, how does one forget the password of mysql? _ MySQL

Source: Internet
Author: User
Solve the problem of mysql forgetting the password bitsCN.com in windows


Solve the problem of forgetting the password of mysql in windows

What if mysql forgets its password sometimes? I will give a case and explanation! Solve the problem!

The actual operations in Windows are as follows:

1. disable running MySQL.

2. open the DOS window and go to the mysql/bin directory.

3. enter mysqld -- skip-grant-tables and press enter. If no prompt is displayed, it is correct.

4. open another DOS window (because the DOS window can no longer be moved) and go to the mysql/bin directory.

5. enter mysql and press Enter. If yes, a MySQL prompt is displayed.>

6. connect to the permission Database> use mysql; (> is the original prompt, don't forget the last semicolon)

6. change the password:> update user set password = password ("123456") where user = "root"; (do not forget the last semicolon)

7. refresh permissions (required steps)> flush privileges;

8. exit>/q

9. log out of the system, log on to MySQL, and log on to MySQL with the username "root" and the new password "123456.

BitsCN.com

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.