Mysql closes skip-grant-tables and quickly resets the mysql password

Source: Internet
Author: User

If you forget the mysql password, there is almost no good way to directly change the password, but we can go to my. in ini, add skip-grant-tables, and restart mysql without the password. Then, modify the root password, and delete and restart skip-grant-tables.

First of all, it is a great honor for you to find this article...

If you forget the mysql password, try the following method.

1. Open my. ini

The Code is as follows: Copy code

[Mysqld]
Port = 3306
# Skip-grant-tables


Add skip-grant-tables at the end

2. Restart the mysqlservice and enter the console (mysql.exe is the fastest in the bindirectory directory)

Enter Password: Press Enter to Enter

3. Use the command to change the password

The Code is as follows: Copy code

Use mysql;
Update user set password = password ('000000') where user = 'root ';


That's good. The modification is complete!

Remember to comment out the added "skip-grant-tables" in my. ini after the modification...

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.