Refer to the original link: https://www.cnblogs.com/cx-code/p/9287274.html
Downloaded mysql5 After 7, run MySQL on the command line and access denied for user ‘ODBC’ @ ‘localhost’ (using password: no)
The solution is as follows:
Stop MySQL service
Find my. Under the MySQL installation directory Ini, find [mysqld] in it and add this sentence below: skip_grant_Tables (skip permission table authentication when starting MySQL service) remember to save.
Find the bin directory of MySQL in CMD, and then enter the command: MySQL – U root – P. enter
Enter: use MySQL
Enter the password to modify: update mysql user set authentication_ String = password (“newly set password”) where user = “root”; (my version of MySQL here is 5.7, in which the attribute of the password column is authentication_string; in 5.1, it is password)
Refresh permissions: flush privileges;
Exit: quit;
Put my Skip in ini_grant_Remove tables and restore the authority table authentication during login
Restart the MySQL service, and then log in with root and the modified password: MySQL – U root – P
Then enter the password for verification, and the successful entry indicates that it is successful