Solution for forgetting MySQL maximum user rights password under Windows

Source: Internet
Author: User
1. Open the MySQL profile My.ini, add the skip-grant-tables to the end of the file, or add it to the bottom of [mysqld] (directly added to the My.ini file at the end of the pro test can, but in [mysqld] I have not tried, Now this file as long as save, do not shut down, will also be used! )。 2. Then restart the MySQL service in Windows environment: net stop MySQL  net start mysql if there is not a valid command, note the configuration of the environment variable 3. Set the root password to open an MS-DOS interface, output mysql– on the command Uroot–p then asked to enter the password, you can now directly enter! (OK, is it possible to log in now?) Now we execute the following statement to update the root password to 123456:update user set Password=password ("123456") where user= ' root '; (note case, Double and single quotes and the last semicolon) 4. Exit MySQLquit5. Restore the configuration file and restart the "Skip-grant-tables" button above to delete it, restart the service if found to enter MySQL5.5 command line again When the client does not need a password at all, execute the following statement 6. Log in to MySQL, using the MySQL database, the specific command is: >mysql;>use mysql;7, change the user table root account password is "123123", the specific command is: >update user Set Password = password (' 123123 '); >flush privileges; (flush privileges is refresh current user rights) 8, exit MySQL, Turn off the MySQL service; 9. Normal start of MySQL service.

Solution for forgetting MySQL maximum user rights password under Windows

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.