1. 程式人生 > 資料庫 >linux 下mysql/firewall/ iptables服務命令

linux 下mysql/firewall/ iptables服務命令

mysql服務相關命令

啟動mysql服務

systemctl start mysqld.service

停止mysql服務

systemctl stop mysqld.service

重啟mysql服務

systemctl restart mysqld.service

檢視mysql服務當前狀態

systemctl status mysqld.service

設定mysql服務開機自啟動

systemctl enable mysqld.service

停止mysql服務開機自啟動

systemctl disable mysqld.service

firewall防火牆相關命令

檢視防火牆狀態

firewall-cmd --state

systemctl status firewalld.service

啟動firewall

systemctl start firewalld.service

停止firewall

systemctl stop firewalld.service

firewall開機啟動

systemctl enable firewalld.service

禁止firewall開機啟動

systemctl disable firewalld.service

iptables命令開放埠相關命令

systemctl start iptables 啟動

systemctl status iptables 檢視執行狀態

systemctl restart iptables.service 重啟

systemctl stop iptables.service 停止

systemctl enable iptables.service 設定開機啟動

systemctl disable iptables.service 禁止開機啟動