查看端口是否运行3306
1.# netstat -ntlp
停止防火墙(centos7以上防火墙)
2.# systemctl stop firewalld.service
关闭防火墙(开机启动)
3.# systemctl disable firewalld.service
如果是iptables防火墙
4.# iptables -F
注意selinux是否是disable
# vi /etc/selinux/config
# getenforce
----------------------------------------------------------
还不行就是mysql不允许连接 需要进入mysql
5.# mysql -u root -p
6.mysql-> grant all on *.* to root@'%' identified by 'root' with grant option;
刷新数据库
7.flush privileges;