MySql error 1045 Access denied for user & #39; root & #39; @ & #39; localhost & #39; (using password: YES) windows solution (forgot password ),

Source: Internet
Author: User

MySql error 1045 Access denied for user 'root' @ 'localhost' (using password: YES) solution for windows (forgot password ),

1. log on to the Administrator console to stop the mysql service: net stop mysql;

2. Go to the mysql installation path. For example, if my installation path is C: \ Program Files \ MySQL Server 5.5, open my. INI file, find [mysqld], add skip_grant_tables under this line, that is, to notify mysql, skip password verification during login, save and exit;

3. Restart the mysql service: net start mysql;

4. On the console, enter mysql-u root-p and enter the password. Press enter to enter mysql;

5. Reset the user root Password and enter: update user set password = Password ('your new password') where user = 'root ';

6. Exit musql and enter quit;

7. stop the mysql Service. On the Administrator console, enter: net stop mysql;

Delete the added skip_grant_tables line in the C: \ Program Files \ MySQL Server 5.5 \ my. ini file;

After saving, restart the mysql service and enter: net start mysql;

8. Log On with the new password.

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.