the last packet sent successfully to the server was 0 milliseconds ago
navicat可以正常访问,jdbc访问就会报错(springboot,dbeaver等会出现这种情况)。
大部分原因是由于数据库回收了连接,而服务(springboot、tomcat等)的缓冲池(dbcp、c3p0、druid等)不知道,继续使用被回收的连接所致。
有效方法:
服务:
使用druid,或者hikari,并且修改连接池配置。
数据库:
修改mysql的配置,最大连接数调到500。
解决异常:“The last packet sent successfully to the server was 0 milliseconds ago. ”的办法
[已解决]踩过的坑之mysql连接报“Communications link failure”错误
The last packet sent successfully to the server was 0 milliseconds ago. 解决办法记录
项目启动报 The last packet sent successfully to the server was 0 milliseconds,神奇错误总结
[转]阿里巴巴数据库连接池 druid配置详解
解决Java程序连接mysql数据库出现CommunicationsException: Communications link failure错误的问题
Druid无效链接回收策略(源码分析)(mysql 8小时连接失效问题)
低版本Druid连接池+MySQL驱动8.0,在高并发下出现线程阻塞、性能受限问题
springboot——高并发之配置连接池druid
高并发场景下的数据库连接池应该如何进行优化(面试)
解决数据库高并发访问瓶颈问题
Mysql高并发解决方案
MySQL 高并发配置优化
MySQL提高并发数