C:\appserv\mysql> Mysql-u Root-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Workaround:
Edit the MySQL profile My.ini (in the MySQL installation directory, my D:\Program files\mysql\mysql Server 5.0\my.ini), add under [mysqld] This entry Skip-grant-tables save quit and restart MySQL
1. Click "Start", "Run" (shortcut key Win+r).
2. Stop: Enter net stop MySQL
3. Start: input net start MySQL
At this time in the cmd input mysql-u root-p can be used without password login, appear password: When the direct return can enter, will not appear error 1045 (28000), but many operations will be limited, because we can not grant (no permission).
Continue to follow the following process:
1. Go to MySQL database:
mysql> use MySQL;
Database changed
2. Set a new password for the root user:
mysql> Update user Set Password=password ("New password") where user= "root";
Query OK, 1 rows affected (0.01 sec)
Rows matched:1 changed:1 warnings:0
3. Refreshing the database
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
4. Exit MySQL:
Mysql> quit;
Bye
After the change, and then modify the My.ini this file, we just joined the "Skip-grant-tables" this line to delete, save the exit and then restart MySQL.
MySQL Access denied for user [email protected] Error resolution method