1、更改数据库权限
# 登陆数据库
mysql -u root -p
# 使用mysql 数据库
use mysql;
# 赋予权限,第一个“*”是数据库名,第二个“*”是表名,root是用户,%代表所有ip, '123456' 是密码
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
# 刷新使赋予权限生效
flush privileges;
2、开放端口
# 开放3306端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
# 保存iptables
/etc/rc.d/init.d/iptables save
# 重启iptables
service iptables restart