[英]MySQL allow remote connections from multiple ip addresses
I am aware of the command 我知道这个命令
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
That will allow remote connections from the ip 1.2.3.4
, but what if I wanted to allow connections from both 1.2.3.4
and 5.6.7.8
? 这将允许来自ip
1.2.3.4
远程连接,但是如果我想允许来自1.2.3.4
和5.6.7.8
连接5.6.7.8
办?
Would it look like this? 它看起来像这样吗?
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4, 5.6.7.8' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
Or is this not allowed? 或者这是不允许的?
You can run above command many times to GRANT access from multiple IPs. 您可以多次运行上述命令以从多个IP进行GRANT访问。
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'5.6.7.8' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
to all ips 对所有人来说
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
With MySQL wildcards. 使用MySQL通配符。 instead of using limited numbers you can implement a wildcard.
而不是使用有限的数字,您可以实现通配符。 this can be done by adding '%' instead of the numbers.
这可以通过添加'%'而不是数字来完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.