datagrip连接linux的mysql失败

今天用datagrip连接linux的mysql的时候失败了

datagrip显示的如下如所示

 

 报的错是

[08S01]
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packetsfrom the server.
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packetsfrom the server.

翻译过来之后也是依托答辩(对于英语菜的我完全看不懂)

一顿操作无果

最后发现需要把linux的防火墙给关了

关闭linux防火墙的命令为

systemctl stop firewalld.service

我们执行如上命令之后

 

再重新测试连接数据库,发现连接成功了

 

 

我们再拓展一下linux部分和防火墙有关的命令

Centos7之前的版本Centos7
开启防火墙

service  iptables  start

systemctl start firewalld.service

关闭防火墙service  iptables  stopsystemctl stop firewalld.service
重启防火墙service  iptables  restartsystemctl restart firewalld.service
查看防火墙状态service  iptables  status        systemctl status firewalld.service

但是这里我们需要知道的是

对于Centos7之前的版本,是有永久打开/关闭防火墙的,而Centos7没有

永久打开防火墙

chkconfig iptables on

永久关闭防火墙chkconfig iptables on

同样的Centos7有以下几个,而Centos7以前的没有

开机启动防火墙

systemctl enable firewalld.servise

开机禁用防火墙

systemctl disenable firewalld.servise

查看防火墙是否开机

systemctl is-enabled  firewalld.servise

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值