欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

MySQL超时时间wait_timeout引发的问题

程序员文章站 2024-01-14 09:02:28
...

异常
MySQL超时时间wait_timeout引发的问题

Caused by: com mysel. jdbc. exceptions. idbc4. CommmicationsException: The last packet successfully received from the server was 139,360 milliseconds ago.
nsider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/connection propertyautoeconnecttrue’ to aoid this problem

经过查阅, 个人理解为这次请求所用的时间139,360毫秒, 超过了数据库所设置wait_timeout的值
MySQL超时时间wait_timeout引发的问题

设置全局的wait_timeout值

SET GLOBAL wait_timeout=28800;

问题解决

相关标签: java