This article is about MySQL error: Access denied for user ' root ' @ ' localhost ' (using password:yes) solution, the interested classmate reference.
Note: The place to add red is the focus
Error description
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Solution Solutions
Windows environment
Edit the MySQL configuration file My.ini (do not know where to search), add skip-grant-tables under the [mysqld] entry
Restart MySQL after saving exit
1. Click "Start", "Run" (shortcut key Win+r).
2. Start: Enter net stop MySQL
3. Stop: Enter net start MySQL
CMD mysql-u root-p Enter
If you report that MySQL is not an executable command under CMD, your MySQL is not added to the environment variable, please automatically CD to the bin directory of the MySQL installation directory and then perform mysql-u root-p carriage return
1. Go to MySQL database:
mysql> use MySQL;
2. Set a new password for the root user:
mysql> Update user Set Password=password ("New password") where user= "root";
3. Refreshing the database
mysql> flush Privileges;
4. Exit MySQL:
Mysql> quit
Modify My.ini This file, we just joined the "skip-grant-tables" This line delete, save exit and restart MySQL can be
Access denied for user ' root ' @ ' localhost ' (using Password:yes) (can be resolved correctly)