1、登錄mysql,授予遠程登錄權限(確保mysql表里的登錄user對應的host為 % 即可;若不是 % ,使用mysql的update更新對應host)
mysql> use mysql; Database changed mysql> select host, user from user; +-----------+---------------+ | host | user | +-----------+---------------+ | % | root | | localhost | mysql.session | | localhost | mysql.sys | +-----------+---------------+ 3 rows in set (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
2、防火牆開放3306端口
添加需要監聽的端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
保存設置
/etc/init.d/iptables save
查看狀態
/etc/init.d/iptables status
OVER!OVER!
