简体   繁体   中英

mysql access denied for user 'odbc'@'localhost' to database

I installed MySql5.5 and set password during installation but when I try to use mysql from windows command prompt, I have get the error:

access denied for user 'odbc'@'localhost' to database password = 'YES'

I would like to change it back into "root@localhost" as well as to reset the password but I can't log in mysql.

How do I login to mysql with root?

You're trying to use the mysql interactive shell? You can specify usernames at the command line:

c:\> mysql -u root -p

where

-u = specify username
-p = prompt for password

I fixed this by implementing a little hacky solution. Downloaded hxd (hex editor) and searched for 'ODBC' (there should only be one match) and just changed it to 'root'.

You are logging into mysql with a default no-rights user, you have to login as root if you want to do everything:

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql.exe -u root -p
Enter Password: *****

If you never specified a root password it should be blank, if you did, you have to remember what it was, or find out how to reset the root password.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM