mysql5.7.22 above version forgot password when this modification

Source: Internet
Author: User
1. Turn off the MySQL service


2. Locate the MySQL installation path find my.ini open under [mysqld] add skip-grant-tables skip password check

3. Login to MySQL mysql-uroot-proot (here root is the password, can also be entered freely)

4. Go to MySQL to change password
mysql> Update Mysql.user Set Authentication_string=password (' root ') where user= ' root ' and Host = ' localhost '; 123456 own New password * Special note is that there is no password field in the user table in the new MySQL database.
(if unsuccessful, repeat step 3
Log in to MySQL with Root: (here my account is root, the password is root)
Mysql-uroot-proot
Then change the password:
SET PASSWORD = PASSWORD (' root ');)

5. Remember to remove the skip-grant-tables from the My.ini or anyone can log in to our database.

mysql5.7.22 above version forgot password when this 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.