连接数据库中出现如下
Failed
[08S01] 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. 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.
问题出在虚拟机没有关防火墙
解决方案
打开虚拟机,打开终端输入以下指定关闭防火墙
1:查看防火状态
systemctl status firewalld
--Active: active (running) 开启状态
--Active: inactive (dead) 关闭状态
2:暂时关闭防火墙重启后会自动开启
systemctl stop firewalld
3:永久关闭防火墙
systemctl disable firewalld
4:重启防火墙
systemctl enable firewalld
输入关闭指令后重新连接,能连接上了