首页 > 数据库 >mysql 错误:The driver has not received any packets from the server.

mysql 错误:The driver has not received any packets from the server.

时间:2022-11-07 19:40:30浏览次数:45  
标签:received jdbc java packets driver reflect ConnectionImpl mysql com


com.mysql.jdbc.exceptions.jdbc4.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 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1038)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:339)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2247)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2280)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2079)

........

 

 

出现以上错误,先尝试使用mysql客户端连接下需要连接的mysql server 数据库。

此错误为,jdbc启动,尝试连接相应地址的数据库(会发送一些用于测试的sql语句),结果没有响应,即连接失败。

标签:received,jdbc,java,packets,driver,reflect,ConnectionImpl,mysql,com
From: https://blog.51cto.com/u_15753094/5831047

相关文章