目 录CONTENT

文章目录

报错:Caused by com.mysql.jdbc.exceptions.jdbc4.CommunicationsException Communications link failure

大T
2022-01-03 / 0 评论 / 0 点赞 / 75 阅读 / 0 字

报错:Caused by  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException  Communications link failure

1、问题描述

The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.)

at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)

at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)

at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)

at org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:139)

at org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:61)

at org.apache.ibatis.session.defaults.DefaultSqlSession.getConnection(DefaultSqlSession.java:298)

... 38 more

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

2、问题原因

其实这个问题的原因是各种各样的,网上有超时的还有别的,处理方法也不同,这里我的问题是因为jdbc版本和mysql不匹配的问题导致的。

大家要根据自己的实际问题处理。

3、解决办法

更改jdbc的驱动:

image

更改为:

image

0

评论区