Error Scenario:
Pop-up Error box when using Navicat to open MySQL
Error code:
ERROR 1045 (28000): Access denied for user ' ODBC ' @ ' localhost ' (using Password:no)
ERROR 1045 (28000): Access denied for user ' ODBC ' @ ' localhost ' (using Password:yes)
Steps to resolve:
1. Locate the profile My.ini, then open it, and choose to open it with Notepad
2.
After opening, search for mysqld keyword
When found, add skip-grant-tables below mysqld to save the exit.
PS: If prompted not to save, you can cut the file to the desktop, change the save and then copy to the MySQL directory
3. Restart MySQL after saving
4.
Then run cmd
Locate the MySQL installation directory under the bin file
Input Mysql-u root-p can be used without password login, appear password: When the direct enter can enter.
5.
Go to MySQL database:
mysql> Use mysql;database changed
2. Set a new password for the root user, and enter the blue section yourself:mysql> Update user set Password=password ("123456") where user= "root";
(Execution success prompt: Query OK, 1 rows affected (0.04 sec) rows matched:1 changed:1 warnings:0)
3. Refresh the database mysql> flush privileges;
4. Exit Mysql:mysql> Quitbye
ps:123456 for the new password, users can change their own password according to their own needs
6. 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 restart the MySQL service.
Note: Follow the above steps to solve the problem, the above content reference Baidu documents.
Workarounds for MySQL Error 1045 (28000) errors