开发者社区> 问答> 正文

使用druid连接池 出现 The last packet successfully receive

使用druid连接池 出现 Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 40,613,430 milliseconds ago,
我已经设置testOnBorrow为true

private String validationQuery = "select 1";
private int validationQueryTimeout = -1;
private boolean testOnBorrow = true;
private boolean testOnReturn = false;
private boolean testWhileIdle = true;
任然出现这样的问题,而且mysql数据库的wait_timeout也是默认的8小时

在链接字符串上加上failOverReadOnly=false试了试

加上failOverReadOnly=false之后大约十天没有出现问题,但大概十天后又报了这个错误,请大佬指点

展开
收起
1122743730556131 2024-07-16 11:39:20 85 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载