如何克服错误1045(28000):对用户“ODBC”@“localhost”(使用密码:NO)的访问被拒绝?

时间:2022-03-17 18:25:41

when am trying to open mysql in windows cmd by typing mysql. the following error is occuring.

当我试图通过输入mysql在windows cmd中打开mysql。出现以下错误。

ERROR 1045 (28000): Access denied for user ODBC@localhost (using password: NO)

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.

然后通过查找类似的查询,我通过使用C:> mysql -u root -p,然后输入密码,来临时解决问题,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:

还有一件事是我创建了一个用户“admin”。但是,当我试图使用命令C:> mysql—user=admin—password=root来打开mysql时,出现以下错误:

C:\Users\abhay kumar>mysql --user=admin --password=root
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password:NO)

Any help will great

任何帮助将大

8 个解决方案

#1


36  

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

出于某种原因,ODBC用户是windows下的默认用户名,即使您在设置时没有创建该用户。只是打字

mysql

without specifying a username will attempt to connect with the non-existent ODBC username, and give:

如果没有指定用户名,将尝试连接不存在的ODBC用户名,并给出:

Error 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

错误1045(28000):用户“ODBC”@“localhost”拒绝访问(使用密码:NO)

Instead, try specifying a username that you know, for example:

相反,尝试指定一个您知道的用户名,例如:

mysql -u root -p

where -u root specified the username root and -p will make the command prompt for a password.

其中-u根指定用户名根,-p将命令提示输入密码。

#2


4  

You need to create an user "ODBC" for MySql with no password. Do that in PHPMyAdmin. That will solve your problem

您需要为没有密码的MySql创建用户“ODBC”。用PHPMyAdmin。这样可以解决你的问题。

如何克服错误1045(28000):对用户“ODBC”@“localhost”(使用密码:NO)的访问被拒绝?

如何克服错误1045(28000):对用户“ODBC”@“localhost”(使用密码:NO)的访问被拒绝?

#3


1  

I tried this and it worked:

我试了一下,结果成功了:

C:\cd MySQL installed path\MySQL -uyourusername -pyourpassword

#4


1  

I know it's been three years since this was asked, but I just figured out this problem for myself. I was using into outfile and getting the error. When I commented out this part of the query, it worked.

我知道这已经有三年了,但我自己解决了这个问题。我使用了outfile并得到了错误。当我注释掉这个部分的查询时,它起作用了。

The FILE privilege is separate from all the others and must be granted to the user running the script.

文件权限是独立于所有其他文件的,必须授予运行该脚本的用户。

GRANT FILE ON *.* TO 'asdfsdf'@'localhost';

#5


0  

C:\Users\abhay kumar>mysql --user=admin --password=root..

This command is working for root user..you can access mysql tool from any where using command prompt..

此命令用于根用户。您可以从任何使用命令提示的地方访问mysql工具。

C:\Users\lelaprasad>mysql --user=root --password=root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.47 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

#6


0  

  1. open command line (run as admin)
  2. 打开命令行(作为admin运行)
  3. go into Mysql server bin folder
  4. 进入Mysql server bin文件夹。
  5. run command: mysqldump -u root -p mydbscheme > mydbscheme_dump.sql
  6. 运行命令:mysqldump -u root -p mydbscheme > mydbscheme_dump.sql。
  7. give your password here against root.
  8. 在这里输入你的密码。

It will work perfect !!

它会完美的工作!!

#7


0  

If you are using dj-database-url check the schema in your DATABASES

如果您正在使用dj-database-url检查数据库中的模式。

https://github.com/kennethreitz/dj-database-url

https://github.com/kennethreitz/dj-database-url

MySQL is

MySQL是

'default': dj_database_url.config(default='mysql://USER:PASSWORD@localhost:PORT/NAME') 

It solves the same error even without the PORT

即使没有端口,它也能解决相同的错误。

You set the password with:

设置密码:

mysql -u user -p 

#8


-1  

I encountered this problem today. I tried mysql -u root -p, but it doesn't work. I restarted the mysql service by two commands: net stop mysql and net start mysql then tried the command mysql. It worked.

我今天遇到了这个问题。我尝试了mysql -u root -p,但它不起作用。我用两个命令重新启动mysql服务:net stop mysql和net start mysql,然后尝试命令mysql。它工作。

#1


36  

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

出于某种原因,ODBC用户是windows下的默认用户名,即使您在设置时没有创建该用户。只是打字

mysql

without specifying a username will attempt to connect with the non-existent ODBC username, and give:

如果没有指定用户名,将尝试连接不存在的ODBC用户名,并给出:

Error 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

错误1045(28000):用户“ODBC”@“localhost”拒绝访问(使用密码:NO)

Instead, try specifying a username that you know, for example:

相反,尝试指定一个您知道的用户名,例如:

mysql -u root -p

where -u root specified the username root and -p will make the command prompt for a password.

其中-u根指定用户名根,-p将命令提示输入密码。

#2


4  

You need to create an user "ODBC" for MySql with no password. Do that in PHPMyAdmin. That will solve your problem

您需要为没有密码的MySql创建用户“ODBC”。用PHPMyAdmin。这样可以解决你的问题。

如何克服错误1045(28000):对用户“ODBC”@“localhost”(使用密码:NO)的访问被拒绝?

如何克服错误1045(28000):对用户“ODBC”@“localhost”(使用密码:NO)的访问被拒绝?

#3


1  

I tried this and it worked:

我试了一下,结果成功了:

C:\cd MySQL installed path\MySQL -uyourusername -pyourpassword

#4


1  

I know it's been three years since this was asked, but I just figured out this problem for myself. I was using into outfile and getting the error. When I commented out this part of the query, it worked.

我知道这已经有三年了,但我自己解决了这个问题。我使用了outfile并得到了错误。当我注释掉这个部分的查询时,它起作用了。

The FILE privilege is separate from all the others and must be granted to the user running the script.

文件权限是独立于所有其他文件的,必须授予运行该脚本的用户。

GRANT FILE ON *.* TO 'asdfsdf'@'localhost';

#5


0  

C:\Users\abhay kumar>mysql --user=admin --password=root..

This command is working for root user..you can access mysql tool from any where using command prompt..

此命令用于根用户。您可以从任何使用命令提示的地方访问mysql工具。

C:\Users\lelaprasad>mysql --user=root --password=root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.47 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

#6


0  

  1. open command line (run as admin)
  2. 打开命令行(作为admin运行)
  3. go into Mysql server bin folder
  4. 进入Mysql server bin文件夹。
  5. run command: mysqldump -u root -p mydbscheme > mydbscheme_dump.sql
  6. 运行命令:mysqldump -u root -p mydbscheme > mydbscheme_dump.sql。
  7. give your password here against root.
  8. 在这里输入你的密码。

It will work perfect !!

它会完美的工作!!

#7


0  

If you are using dj-database-url check the schema in your DATABASES

如果您正在使用dj-database-url检查数据库中的模式。

https://github.com/kennethreitz/dj-database-url

https://github.com/kennethreitz/dj-database-url

MySQL is

MySQL是

'default': dj_database_url.config(default='mysql://USER:PASSWORD@localhost:PORT/NAME') 

It solves the same error even without the PORT

即使没有端口,它也能解决相同的错误。

You set the password with:

设置密码:

mysql -u user -p 

#8


-1  

I encountered this problem today. I tried mysql -u root -p, but it doesn't work. I restarted the mysql service by two commands: net stop mysql and net start mysql then tried the command mysql. It worked.

我今天遇到了这个问题。我尝试了mysql -u root -p,但它不起作用。我用两个命令重新启动mysql服务:net stop mysql和net start mysql,然后尝试命令mysql。它工作。