開啟centos中指定的埠

2021-09-11 09:54:19 字數 517 閱讀 1599

今天,想通過第三方工具遠端連線雲伺服器上的mysql-server,但是一直連不上,原本以為是在資料庫中的mysql.user表中沒有設定host為%(也就是說沒有設定為任意ip都可以進行連線),但是查過以後發現其實已經設定過了。既然這個已經設定好了,mysql-server執行正常,那就是防火牆的問題咯。查了一下防火牆:

service iptables status複製**
結果如下:

可以看到3306埠狀態是drop,也就是說防火牆禁用掉了3306埠

原本在虛擬機器上操作的時候,都是直接將iptables服務關掉,但是在真實環境中,防火牆是絕對不能直接關掉的,那就只能單獨將3306埠開啟吧

cd /etc/sysconfig/

vim iptables複製**

將標紅處的drop修改為accept,然後的重啟防火牆(service iptables restart)就好了

centos7開啟防火牆和開啟指定埠

1 開啟防火牆firewall cmd statesystemctl start firewalld.servicesystemctl enable firewalld.servicesystemctl restart firewalld.servicefirewall cmd statesyste...

centos開啟關閉指定埠(防火牆應用)

檢視防火牆 systemctl status firewalld 開啟防火牆 systemctl start firewalld 關閉防火牆 systemctl stop firewalld 防火牆開機啟動 systemctl enable firewalld 檢視防火牆所有開放的埠 firewal...

Qt開啟指定目錄並選中指定檔案

這篇部落格 上說的方法適用,但windows上需要注意乙個問題 要開啟的檔案路徑必須是 連線的,所以需要在程式中新增一句 如下 qstring filename qprocess process filename 你要開啟的檔案路徑 包括檔名 ifdef win32 filename.replace...