MySQL forgot password, how to reset the new password (mysql5.6 has been tested OK)

Source: Internet
Author: User

What if MySQL forgets the password?

1. Turn off the MySQL service.

2. Create a new c:\my-init.txt text file, reset your new password to NewPassword, as follows:

UPDATE mysql.user SET password=password (' newpassword ') WHERE user= ' root '; FLUSH privileges;

3. Open a new command line and enter the command as shown (this is installed by the MySQL wizard, so you can do it):

The path of the My.ini file is pressed to get:

Run the contents of the command line, you can modify the new password.

To unzip the installation directly, press the following command:

C:\> C:\mysql\bin\mysqld--init-file=c:\\mysql-init.txt


4. Through the client to test, to see if the modification succeeds, if unsuccessful, check the command line in detail if there is any wrong input.

5. After success, the Mysqld.exe is closed by the work manager and then the MySQL service is started at the service.


MySQL forgot password, how to reset the new password (mysql5.6 has been tested OK)

Related Article

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.