900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > MySQL连接超时自动断开连接问题

MySQL连接超时自动断开连接问题

时间:2024-04-24 12:00:52

相关推荐

MySQL连接超时自动断开连接问题

数据库|mysql教程

MySQL,连接,超时,自动,断开,问题,欢迎,进入,Lin

数据库-mysql教程

qq群机器人管理平台网站源码,vscode命名插件,怎么在ubuntu上跑c,tomcat 部署 php,db.sqlite 读取,js 表单校验插件 div提示,前端说明日志框架,爬虫爬取流量信息,php 下载header,资阳seo定做,社区门户网站模板,ios网页html模板下载工具,小蚂蚁门户模板,微信程序lzw

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 描述: 用mybatis2.3.5实现做应用时,程序中报以下错误: com.mysql.jdbc.municationsException: The last packet successfully received from the server was 79,221,885 milli

购物软件源码下载,怎么拷贝ubuntu系统,python网络爬虫解析,php回调函php回调函,翁源seo公司lzw

topthink 源码,unity设置vscode,urxvt ubuntu,openas和tomcat,cmd进不了sqlite,jq走马灯插件,前端框架工具排行榜,爬虫抓取微博评论,php 取本周,网店深度seo优化,拍客竞拍网站源码,弹出窗口播放网页视频,网站设计介绍演讲模板下载lzw

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

描述:

用mybatis2.3.5实现做应用时,程序中报以下错误:

com.mysql.jdbc.municationsException:

The last packet successfully received from the server was 79,221,885 milliseconds ago.

The last packet sent successfully to the server was 79,221,885 milliseconds ago.

is longer than the server configured value of ‘wait_timeout’.

You should consider either expiring and/or testing connection validity before use in your application,

increasing the server configured values for client timeouts, or using the Connector/J connection property ‘autoReconnect=true’ to avoid this problem.

解释及解决办法:

如果连接闲置8小时 (mysql的wait_timeout参数默认时间), mysql就会自动断开连接, 得刷新应用才行.

不用hibernate的话, connection url加参数:

autoReconnect=true

用hibernate的话, 加如下属性:

true

true

true

要是还用c3p0连接池:

1

0

0

true

例:

jdbc.url=jdbc:mysql://localhost:3306/yht_wxt?zeroDateTimeBehavior=convertToNull&useUnicode=True&characterEncoding=utf8&autoReconnect=true&autoReconnectForPools=true

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。