查看端口是否運(yùn)行3306
1.#?netstat -ntlp
停止防火墻(centos7以上防火墻)
2.#?systemctl stop firewalld.service
關(guān)閉防火墻(開機(jī)啟動)
3.#?systemctl disable firewalld.service
如果是iptables防火墻
4.#?iptables -F
注意selinux是否是disable
# vi /etc/selinux/config
# getenforce
----------------------------------------------------------
還不行就是mysql不允許連接 需要進(jìn)入mysql
5.#?mysql -u root -p
6.mysql->?grant all on *.* to root@'%' identified by 'root' with grant option;
刷新數(shù)據(jù)庫
7.flush?privileges;