mysql连接com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

现象:客户端连接服务器端mysql是没问题的,所有都木有问题,应用程序配置也没问题,但是连接就抛异常:

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.

死活修改都不ok,google后,将:

<!--mysql  -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.</version>
</dependency>

版本修改为:5.1.14就OK了。不知道为什么,先mark一下。

上一篇:解决MySQL连接超时Communications link failure due to underlying exception


下一篇:解决Java程序连接mysql数据库出现CommunicationsException: Communications link failure错误的问题