我如何在mysqlconfiguration中添加可信主机名?
webserver.mysomain.com dbserver.mydomain.com
我想在安装在dbserver.mydomain.com中的mysql数据库中添加webserver.mydomain.com
所以来自webserver.mydomain.com的所有连接都必须被接受。
谢谢
我不确定你想在这里实现什么,也不知道mysql是否有可信主机的概念。 但是,如果你是出于安全原因这样做,那么在用户级别添加用户时在用户级别执行。 换句话说,你将不得不在mysql中设置一个只从web服务器连接的用户,你可以通过grant privileges选项来实现 –
mysql> grant all privileges on *.* to [email protected] identified by 'password'; mysql> flush privileges;
最重要的是,修改你的防火墙规则,允许来自webserver.mydomain.com的mysql连接(端口3306) – 在iptables中,你可以这样做:
/sbin/iptables -I INPUT -s webserver-ip-address -p tcp --dport 3306 -j ACCEPT