Reset MySQL password under windows (the first reason is because access denied for user ' root ' @ ' localhost ' is not able to log on to ' root ' @ ' localhost ')

Source: Internet
Author: User

I use the MySQL5.5, other versions have not been tested.

1. Go to the Command Line window and stop the MySQL service

    1. net stop MySQL

2. Enter Mysqld--skip-grant-tables (the current CMD window may not respond, ignore)

3. Reopen a CMD window and perform the following actions:

    1. Mysql-uroot
    2. Update Mysql.user set Password=password (' New password ') where user= ' root ';


4. Open Task Manager to end the Mysql.exe,mysqld.exe process

5. Restart the MySQL service (net start MSYQL) (if you are prompted that MySQL boot is unsuccessful, the reset password will mostly fail, you can restart Windows and repeat the above).

--------------------------------------------------------------------------------------------------------------- -

In summary, resetting the MySQL password is successful and can be tested in the following ways:

Reset MySQL password under windows (the first reason is because access denied for user ' root ' @ ' localhost ' is not able to log on to ' root ' @ ' localhost ')

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.