Windows Mysql5.7 forgot root password solution

Source: Internet
Author: User

1. Open the first CMD window to execute net stop mysql57

2. Execute mysqld--defaults-file= "C:\ProgramData\MySQL\MySQL Server 5.7\my.ini"--skip-grant-tables in the first CMD window--- Note the path (whichever is your actual situation)

3, open the second cmd window to execute mysql-uroot-p prompt input password, direct return (do not enter the password)

4, select the database: Use mysql;

5. Update Root password: Update user set Authentication_string=password (' New password ') where user= ' root ' and host= ' localhost ';

6, Refresh permissions: Flush privileges;

7. Exit: Quit

8, re-login: MySQL -uroot -P prompt to enter a password, then enter the password to log in. Complete!!!

Windows Mysql5.7 forgot root 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.