【MySQL】配置防火牆,允許外部存取

來源:互聯網
上載者:User

標籤:mysql centos7.1 firewall

CentOS 7.1 版本


// 查看 firewalld

[[email protected] 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.

[[email protected] sysconfig]# 


// 查看 zone

[[email protected] sysconfig]# firewall-cmd --get-active-zones

public

  interfaces: enp7s0f0 enp7s0f1

[[email protected] sysconfig]# 


// 添加連接埠3306,並重啟

[[email protected] sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/tcp

success

[[email protected] sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/udp

success

[[email protected] sysconfig]# firewall-cmd --reload

success

[[email protected] sysconfig]#


// 測試


【MySQL】配置防火牆,允許外部存取

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.