连接云服务器的MySQL数据库报错The driver has not received any packets from the server.

很多时候并不是像网上写的那样

  • 1、改jdbc.url=jdbc:mysql://localhost:3306/tgmtest?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false
  • 2、改MySQL配置文件 wait_timeout=31536000 interactive_timeout=31536000

重点要确定一下服务器的防火墙是否关闭了,,因为有时候它会开机重启。。
连接云服务器的MySQL数据库报错The driver has not received any packets from the server._第1张图片

//关闭firewall:
//停止firewall
systemctl stop firewalld.service 
//禁止firewall开机启动
systemctl disable firewalld.service 
//查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
firewall-cmd --state 

这就运行通过了
连接云服务器的MySQL数据库报错The driver has not received any packets from the server._第2张图片

你可能感兴趣的:(云服务器)