码迷,mamicode.com
首页 > 数据库 > 详细

【MySQL】配置防火墙,允许外部访问

时间:2015-07-04 23:37:32      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:mysql centos7.1 firewall

CentOS 7.1 版本


// 查看 firewalld

[root@wode006 sysconfig]# systemctl status firewalld

firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)

   Active: active (running) since 六 2015-07-04 20:56:57 CST; 1min 52s ago

 Main PID: 8911 (firewalld)

   CGroup: /system.slice/firewalld.service

           └─8911 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid


7月 04 20:56:57 wode006 systemd[1]: Started firewalld - dynamic firewall d...n.

Hint: Some lines were ellipsized, use -l to show in full.

[root@wode006 sysconfig]# 


// 查看 zone

[root@wode006 sysconfig]# firewall-cmd --get-active-zones

public

  interfaces: enp7s0f0 enp7s0f1

[root@wode006 sysconfig]# 


// 添加端口3306,并重启

[root@wode006 sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/tcp

success

[root@wode006 sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/udp

success

[root@wode006 sysconfig]# firewall-cmd --reload

success

[root@wode006 sysconfig]#


// 测试


【MySQL】配置防火墙,允许外部访问

标签:mysql centos7.1 firewall

原文地址:http://huangchao.blog.51cto.com/10446378/1670970

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!