如何克服错误1045(28000):永久拒绝用户'ODBC'@'localhost'的访问(使用密码:NO) [英] how to overcome ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) permanently
问题描述
当尝试通过键入mysql在Windows cmd中打开mysql时.发生以下错误.
when am trying to open mysql in windows cmd by typing mysql. the following error is occuring.
ERROR 1045 (28000): Access denied for user ODBC@localhost (using password: NO)
然后通过查找类似的查询,我以某种方式得到了一个临时解决方案
C:> mysql -u root -p
,然后输入密码,mysql
正在工作.但是当我打开和关闭时,同样的问题又出现了.
And then by looking similar queries i somehow got a temporary solution by using
C:> mysql -u root -p
and then typing the password, mysql
is working. But when i close and open, the same problem is recurring.
另一件事是我创建了一个用户"admin".但是当我尝试使用命令C:> mysql --user=admin --password=root
打开mysql时,发生以下错误:
One more thing is that i have created a user 'admin'. but when am trying to open mysql using the command C:> mysql --user=admin --password=root
, the following error is occuring:
C:\Users\abhay kumar>mysql --user=admin --password=root
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password:NO)
任何帮助都会很棒
推荐答案
出于某种原因,即使在安装时未创建该用户,ODBC用户也是Windows下的默认用户名.只需输入
for some reason, the ODBC user is the default username under windows even if you didn't create that user at setup time. simply typing
mysql
不指定用户名将尝试与不存在的ODBC用户名连接,并给出:
without specifying a username will attempt to connect with the non-existent ODBC username, and give:
错误1045(28000):用户'ODBC'@'localhost'的访问被拒绝(使用密码:否)
Error 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
相反,请尝试指定一个您知道的用户名,例如:
Instead, try specifying a username that you know, for example:
mysql -u root -p
其中-u root
指定用户名root
,而-p
将在命令提示符下输入密码.
where -u root
specified the username root
and -p
will make the command prompt for a password.
这篇关于如何克服错误1045(28000):永久拒绝用户'ODBC'@'localhost'的访问(使用密码:NO)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!