Tag Archives: Access denied for user ‘ODBC’@’localhost’ (using password: NO)

[Solved] Access denied for user ‘ODBC’@’localhost’ (using password: NO)

An error encountered when deploying the company’s web project to myeclipse: Access denied for user’ODBC’@’localhost’ (using password: NO), it seems that mysql does not allow remote access by default.

For the record, the solution is as follows :

 

1. Stop mysql service

2. Find my.ini in the mysql installation directory, find [mysqld] inside and add this sentence below: skip_grant_tables (skip the authorization table authentication when starting the MySQL service)

Remember to save and save.

3. Find the bin directory of myql in cmd, and enter the command: mysql -u root -p

No need to enter a password, press Enter

 

4. After entering, enter: use mysql

 

5. Modify the password input: update mysql.user set authentication_string = password(“newly set password”) where user=”root”; (My mysql version is 5.7, and the attribute of the password column is called authentication_string; 5.1 is password );

 

6. Flush privileges: flush privileges;

7. Exit: quit;

8. Remove the skip_grant_tables in my.ini and restore the authorization table authentication when logging in

9. Restart the mysql service, and then log in with root and the modified password: mysql -u root -p

Then enter the password to verify. Successful entry means success.

 

The above are the specific steps, I hope to help you with the problem,