Reprinted -- MYSQL5.7: Access denied for user & #39; root & #39; @ & #39; localhost & #39; (using password: YES) solution, -- mysql5.7denied

Source: Internet
Author: User

Reprinted -- MYSQL5.7: Access denied for user 'root' @ 'localhost' (using password: YES) solution, -- mysql5.7denied

1. Open the my. ini file in the MySQL directory, add "skip-grant-tables" at the end of the file, and save and close the file;

2. Restart the MySQL service;

3. Enter the MySQL bin directory through the cmd Line, enter "mysql-u root-p" (no password), and press enter to enter the database;

4. Run "use mysql;" to use the mysql database;

5. Execute update mysql. user set authentication_string = password ('000000') where user = 'root' and Host = 'localhost'; (modify the root password );

6. Open the my. ini file in the MySQL directory, delete "skip-grant-tables" in the last line, and save and close the file;

7. mysql> flush privileges;

8. mysql> quit;

9. Enter "mysql-u root-p 123456" in the command line to connect to the database.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. Http://blog.csdn.net/wzhedward/article/details/71036689

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.