mysql访问被拒绝为用户的“odbc”@“localhost”到数据库。

时间:2022-06-01 18:29:19

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:

我在安装过程中安装了MySql5.5并设置了密码,但是当我试图从windows命令提示符中使用mysql时,我得到了错误:

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.

我想把它改回“root@localhost”,并重新设置密码,但我无法登录mysql。

How do I login to mysql with root?

我如何用root用户登录mysql ?

2 个解决方案

#1


9  

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

你在尝试使用mysql交互式shell?您可以在命令行中指定用户名:

c:\> mysql -u root -p

where

在哪里

-u = specify username
-p = prompt for password

#2


0  

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

你登录mysql默认的无权限用户,如果你想做所有事情,你必须以root身份登录:

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.

如果您没有指定根密码,它应该是空白的,如果您这样做了,您必须记住它是什么,或者找到如何重新设置根密码。

#1


9  

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

你在尝试使用mysql交互式shell?您可以在命令行中指定用户名:

c:\> mysql -u root -p

where

在哪里

-u = specify username
-p = prompt for password

#2


0  

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

你登录mysql默认的无权限用户,如果你想做所有事情,你必须以root身份登录:

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.

如果您没有指定根密码,它应该是空白的,如果您这样做了,您必须记住它是什么,或者找到如何重新设置根密码。