MySQL5.7 Forgot Password Solution

Source: Internet
Author: User

The first of these methods

First of all, it's generally seen online.

    1. Close Service
    2. windowsUnder in C:\ProgramData(隐藏文件夹)\MySQL\MySQL Server 5.7\my.ini the [mysqld]下 addskip-grant-tables
    3. Restart the service, login again now no password required
    4. Delete the original sentence skip-grant-tables , and then restart the service on the OK

But I follow this method in the third step of the time still need a password, if a classmate is like me, you can try the following method

The second method of
    1. Close Service
    2. windowsUnder in C:\ProgramData\MySQL\MySQL Server 5.7\my.ini the [mysqld]下 addskip-grant-tables
    3. In a cmd window just enter mysqld --skip-grant-tables , and then open the second window direct input mysql can be directly into the

Change password, following several commands

    1. use mysql
    2. update user set authentication_string=password(‘密码‘) where user="用户" and host=‘localhost‘;
    3. flush privileges;
    4. Delete the original sentence, restart the skip-grant-tables service

MySQL5.7 Forgot Password Solution

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.