ERROR 1045(28000):拒绝用户访问(使用密码:是)(ERROR 1045 (28000): Access denied for user (using password: YES))

编程入门 行业动态 更新时间:2024-10-26 08:25:53
ERROR 1045(28000):拒绝用户访问(使用密码:是)(ERROR 1045 (28000): Access denied for user (using password: YES))

我试图在服务器上有一个简单的mysql数据库,在另一个连接到它的服务器上有另一个数据库。

我做了以下事情:

安装了mysql-server 创建了数据库

创建用户:

创建用户admin @'localhost'标识为'admin';

给定此用户的权限:

在confWeb上授予所有特权。*管理员@'';

打开了bind-adress

现在,当我从另一台服务器启动命令mysql -u admin -p -h <address> ,它只是一次又一次地告诉我:

ERROR 1045 (28000): Access denied for user 'admin'@'X.X.X.X' (using password: YES)

我真的不知道该做什么。 我想我已经尝试了一切。 我尝试在GRANT行的末尾放置GRANT OPTION ,我尝试了许多不同的地址,但没有任何效果。

I am trying to have a simple mysql Database on a server and another database on another server that connects to it.

I have done the following :

Installed mysql-server Created the database

Created the user with :

CREATE USER admin@'localhost' IDENTIFIED BY 'admin';

Given the privileges to this user with :

GRANT ALL PRIVILEGES ON confWeb.* TO admin@'';

Opened the bind-adress

Now when I launch the command mysql -u admin -p -h <address> from another server, it just tells me again and again :

ERROR 1045 (28000): Access denied for user 'admin'@'X.X.X.X' (using password: YES)

I really have no idea what to do at this point. I think I've tried everything. I tried putting GRANT OPTION in the end of the GRANT line, I tried allowing a lot of different addresses but nothing worked.

最满意答案

在MySQL中, 用户主机都标识用户

这个用户:

admin@localhost

与用户不一样

admin@'10.242.167.235'

作为一个选项,您可以这样做以允许连接:

GRANT USAGE ON *.* TO admin@'10.242.167.235' IDENTIFIED BY 'mysecret' ; GRANT ALL ON confWeb.* TO admin@'10.242.167.235' ;

有关MySQL访问权限系统的更长时间的讨论,包括“通配符”,localhost的特殊含义,使用IP地址而不是主机名等。

http://dev.mysql.com/doc/refman/5.7/en/privilege-system.html

In MySQL, a user is identified by both user and host.

This user:

admin@localhost

is not the same user as

admin@'10.242.167.235'

As one option, you could do this to allow connection:

GRANT USAGE ON *.* TO admin@'10.242.167.235' IDENTIFIED BY 'mysecret' ; GRANT ALL ON confWeb.* TO admin@'10.242.167.235' ;

For a longer discussion of the MySQL Access Privilege System, including "wildcards", the special meaning of localhost, using IP addresses instead of hostnames, etc.

http://dev.mysql.com/doc/refman/5.7/en/privilege-system.html

更多推荐

本文发布于:2023-07-04 10:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1023512.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密码   用户   ERROR   denied   user

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!