长虫山小木屋

没有谁会为你踏雪而来 喜欢的风景要躬亲筚路

  博客园  :: 首页  :: 新随笔  :: 联系 ::  :: 管理

 一:iptables 设置开放3306访问

iptables -L -n --line-numbers

1,删除DROP 3306

iptables -D INPUT 5

5是你查询到的序号

 

2,添加 ACCEPT 3306 

iptables -A INPUT -p tcp --dport 3306 -j ACCEPT

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT 

 

保存,重启

service iptables save

service iptables restart

----

27 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306

 

二:设置Mysql 账号运行远程访问

 

参考资料:https://www.vpser.net/security/linux-iptables.html

posted on 2020-06-11 11:11  长虫山小木屋  阅读(104)  评论(0编辑  收藏  举报