1. 修改mysql配置文件
# whereis mysql
#cd /etc/mysql
#cp my.conf my.conf.bak
#vi my.conf
查找 bind-address = 127.0.0.1、
再这一句前加一个#号如
#bind-address = 127.0.0.1
:q保存退出
#服务器开放3306的端口
#netstat -an | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
上门为成功结果。就是把127.0.0.1改为默认的0.0.0.0