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