Error phenomenon:
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)
Under Windows, the solutions to the above two errors have been tested by me personally and are effective. I now share the solutions as follows:
1. Find the configuration file my.ini and open it. You can choose to open it with Notepad.
2. After opening, search for the mysqld keyword. After finding it, add skip-grant-tables under mysqld, save and exit. PS: If you are prompted not to save, you can cut the file to the desktop, save the changes, and then copy it to the mySQL directory.
3. Restart mySQL after saving.
4. Run cmd, enter mysql -u root -p to log in without a password. When password: appears, just press Enter to enter.
5. Enter the mysql database:
1).Switch database: mysql> use mysql;Database changed
2).Set a new password for the root user: mysql> update user set password=password("123456") where user="root";
3). Refresh the database: mysql> flush privileges;
4).Quit mysql: mysql> quitBye
PS: 123456 is the new password. Users can change it to their own password according to their needs.
6. After making the changes, modify the my.ini file again, delete the "skip-grant-tables" line we just added, save and exit, and then restart the mysql service.
The above is the entire content of this article. I hope it will be helpful to everyone in solving the MySQL ERROR 1045 (28000) error problem.