> 技术文档 > Docker问题:beaver 连接虚拟机mysql失败,Communications link failureThe last packet sent successfully to the_communications link failure the last packet sent s

Docker问题:beaver 连接虚拟机mysql失败,Communications link failureThe last packet sent successfully to the_communications link failure the last packet sent s


目录

  • 问题描述
  • 解决办法
    • 第一步:搞通网络
    • 第二步:选择正确的ip
    • 第三步:关闭防火墙

问题描述

我使用dbeaver连接虚拟机VMware Station的MySQL5.7版本,出现如下错误:Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Connect timed out

Docker问题:beaver 连接虚拟机mysql失败,Communications link failureThe last packet sent successfully to the_communications link failure the last packet sent s

解决办法

总共有三个步骤

第一步:搞通网络

虚拟机和本机,先都ping一下ip地址,看看网络是否ping得通,别到时候是网络问题,就真的会谢。
在本机上就是cmd,然后ipconfig命令,注意这里是ip,是p,本机就是ipv4的地址
Docker问题:beaver 连接虚拟机mysql失败,Communications link failureThe last packet sent successfully to the_communications link failure the last packet sent s

在虚拟机上可以用ifconfig或者ip addr,自己选一个都可以,注意这里是if,是f,虚拟机就是ens33的地址。
Docker问题:beaver 连接虚拟机mysql失败,Communications link failureThe last packet sent successfully to the_communications link failure the last packet sent s

ping ip地址

要都能ping通,不然网络都连接不了,就是用虚拟机ping主机,用主机ping虚拟机,要是没搞通,虚拟机就重启网络试一试。
虚拟机上执行这条命令:

systemctl restart network

首先,一定要ping通!!!后面都是基于网络正常的,不然都是空谈!

第二步:选择正确的ip

dbeaver进行连接时,地址的填写,傻乎乎的写localhost可是不行的,刚开始我就是这样的,被自己蠢笑了!
Docker问题:beaver 连接虚拟机mysql失败,Communications link failureThe last packet sent successfully to the_communications link failure the last packet sent s

第三步:关闭防火墙

好,搞完上述的活动,我还是失败了,我真的服了,不要担心,总是有解决办法的,这不来了!
搞了半天,是我的虚拟机开启了防火墙,所以我进不去啊。在虚拟机上执行如下命令:

systemctl stop firewalld

再次使用dbeaver进行连接。
Docker问题:beaver 连接虚拟机mysql失败,Communications link failureThe last packet sent successfully to the_communications link failure the last packet sent s
恭喜我们成功啦!快去试一试吧,肯定可以哒!

最后,BB,如果方法对您有帮助的话,记得给我点个赞赞
谢谢啦~

今天中午吃法加蛋忘记备注要炒到菜里面了,明天要记得,都不敢想象明天的菜会有多好吃!