admin管理员组

文章数量:1619183

启动程序时报错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.

com.mysql.cj.jdbc.exceptions.CommunicationsException: 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.
 at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.17.jar:8.0.17]

网上各种方式都试了,还是没有解决,最后把jdk版本降了就解决了…

其他可能的原因:
1、MySQL数据服务没有开启导致连接失败
2、MySQL数据库设置成了外网不能访问,需要开启外网IP访问的功能。
3、可能是网络问题,导致连接不上,ping一下MySQL所在主机的IP
4、数据设置wait_timeout时间,在默认配置不改变的情况下,如果连续8小时内都没有访问数据库的操作,再次访问mysql数据库的时候,mysql数据库会拒绝访问。

本文标签: CommunicationsLINKfailure