1、详细报错信息
Communications link failure The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
2、错误分析
登录mysql数据库,查看mysql链接等待时间
mysql﹥ show global variables like ‘wait_timeout’;
查阅资料:
https://download.csdn.net/download/weixin_38590685/13694912?utm_medium=distribute.pc_relevant_download.none-task-download-2~default~OPENSEARCH~default-2.test_version_3&depth_1-utm_source=distribute.pc_relevant_download.none-task-download-2~default~OPENSEARCH~default-2.test_version_3
最好的解决方法:如果使用了c3p0连接池,可以配置idleConnectionTestPeriod 属性,每多少秒检查所有连接池中的空闲连接,把该值设置的小于mysql的wait_timeout值即可;
3、最终解决办法
在连接串后面加了个useSSL=false可以了,应该是mysql服务升级通讯协议了。