600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > mysql:Communications link failure解决【MySQL】

mysql:Communications link failure解决【MySQL】

时间:2019-08-10 08:40:14

相关推荐

mysql:Communications link failure解决【MySQL】

数据库|mysql教程

mysql:Communicationslinkfailur

数据库-mysql教程

mysql: Communications link failure解决

邮件收发系统源码,vscode取消列模式,ubuntu粘贴灰色,cmd查找tomcat启动,爬虫sleep,php视频源码下载,惠州seo快速优化收费,模板网站程序,注册登录页模板下载地址lzw

使用Connector/J连接MySQL,程序运行较长时间后就会报以下错误:

mvc4 ef5搭建杂志网站学习源码,vscode颜色怎么设置,ubuntu 多窗口,tomcat免项目名,爬虫程序 股票,php高级编程 框架,广东seo优化品质保障,h5下载网站源码下载,html5响应式博客模板lzw

Communications link failure,The last packet successfully received from the server was *** millisecond ago.The last packet successfully sent to the server was *** millisecond ago。

html禁止查看源码,vscode自定义头部注释,ubuntu16.1,tomcat开启调试端口,.net core爬虫,php上传图片压缩大小,seo优化怎么做自媒体lzw

其中错误还会提示你修改wait_timeout或是使用Connector/J的autoReconnect属性避免该错误。

MySQL服务器默认的“wait_timeout”是28800秒即8小时,意味着如果一个连接的空闲时间超过8个小时,MySQL将自动断开该连接,而连接池却认为该连接还是有效的(因为并未校验连接的有效性),当应用申请使用该连接时,就会导致上面的报错。

解决办法有两个:

一是修改f:

wait_timeout=31536000

interactive_timeout=31536000

将过期时间修改为1年。

二是在连接URL上添加参数:&autoReconnect=true&failOverReadOnly=false

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