我试图在服务器上有一个简单的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 databaseCreated 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@localhostis 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
更多推荐
发布评论