navicat连不上阿里云mysql数据库

1.阿里云后台安全实例,添加开启mysql端口3306,入方向mysql

2.登陆到mysql, 受权外部可连接sql

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;centos

FLUSH PRIVILEGES;安全

 

3.修改my.cnf配置[mysqld中]。添加bash

bind-address = 0.0.0.0服务器

 

4.重启mysql,/etc/init.d/mysql restart ssh

 

打开端口:tcp

iptables -I INPUT -i eth0 -p tcp --dport 3306 -j ACCEPT    #开放3690端口阿里云

>/etc/init.d/iptables save #保存配置spa

service iptables save  #保存iptable规则

启动防火墙:

systemctl start firewalld # 启动,

  systemctl enable firewalld # 开机启动

  systemctl stop firewalld # 关闭

  systemctl disable firewalld # 取消开机启动

或者:

三、防火墙检测
1)iptables --list查看;
2)开启防火墙3306端口
vi /etc/sysconfig/iptables
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT(容许3306端口经过防火墙)
/etc/init.d/iptables restart(重启防火墙使配置生效)
3)或者直接关闭防火墙; 参考:http://blog.csdn.net/fjssharpsword/article/details/50973283
centos 7 之后是修改 firewall
systemctl start firewalld # 启动,

systemctl enable firewalld # 开机启动

systemctl stop firewalld # 关闭

systemctl disable firewalld # 取消开机启动

 

 

5.还不行就重启服务器。

相关文章
相关标签/搜索