1、配置防火墻,開啟80端口、3306端口 [root@localhost ~]# vim /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #允許80端口通過防火墻 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #允許3306端口通過防火墻 備注:很多網友把這兩條規則添加到防火墻配置的最后一行,導致防火墻啟動失敗,正確的應該是添加到默認的22端口這條規則的下面 如下所示: ######################################################## # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT ########################################################
MySQL遠程登錄 設置mysql密碼 mysql> USE mysql; mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root'; mysql> FLUSH PRIVILEGES; 允許遠程登錄 [root@localhost ~]# mysql -u root -p Enter Password: mysql> GRANT ALL PRIVILEGES ON *.* TO '用戶名'@'%' IDENTIFIED BY '密碼' WITH GRANT OPTION; 完成后就能用mysql-front遠程管理mysql了。 設為開機啟動 [root@localhost ~]# chkconfig mysqld on