Communications link failure:The last packet successfully received from the server was 0 millisecond ago
出现这种错误的大致情况如下:
1、数据库连接长时间未使用,断开连接后,再去连接出现这种情况。这种情况常见于用连接池连接数据库出现的问题
2、数据库连接的后缀参数问题
针对上述两种情况,解决方案如下
1、修改MySQL的参数,my.cnf位于/etc目录下,修改完成后,重启mysql
wait_timeout最大为31536000即1年,在my.cnf中加入:
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000
2、连接数据库的时候参数问题
如果使用mysql版本为5.7+,驱动Driver使用的是:com.msyql.cj.jdbc.Driver
那么你必须在连接url后面添加
useSSL=false
3、直接修改mysql的参数,不用重启
进入mysql的命令行或者客户端
show global variables like '%wait_timeout%';
将wait_timeout 和interactive_timeout 设置的大一点。默认是8小时(28800)。
set global wait_timeout=604800;
set global interactive_timeout=604800;
刷新缓存
flush privileges;
Communications link failure:The last packet successfully received from the server was 0 millisecond ago的更多相关文章
- 【错误】:Could not open JDBC Connection for transaction; nested exception is: Communications link failure;The last packet sent successfully to the server was 1 milliseconds ago
# #错误日志 2016-11-10 16:19:20,834 ERROR [org.quartz.core.JobRunShell] - Job DEFAULT.jobtask threw an u ...
- The last packet successfully received from the server was 20,519 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
本地升级了下MySQL的版本,从5.6升为5.7,数据文件直接拷贝的,项目查询数据库报错: Could not retrieve transation read-only status server ...
- The last packet successfully received from the server was 1,480 milliseconds ago.
场景:一个上传接口,需要上传几十M的文件,文件中包含10几W的数据,然后对10+W的数据进行同步批量插入,每次批量插入1W.最后返回结果. 项目上线一段时间后,上传接口出现问题,数据库用的MySQL5 ...
- Communications link failure,The last packet successfully received from the server was *** millisecon
使用Connector/J连接MySQL数据库,程序运行较长时间后就会报以下错误: Communications link failure,The last packet successfully r ...
- org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent succ
数据库 没有开启 连接失败 org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause ...
- The last packet successfully received from the server was 2,926,157 milliseconds ago. The last packet sent successfully to the server was 2,926,158 milliseconds ago. is longer than the server configured value of 'wait_timeout'. 解决办法
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully rec ...
- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 78,050,512 milliseconds ago.
今天访问已经架上服务器的网站,报错: Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet s ...
- Mysql 的异常:The last packet successfully received from the server was 90 milliseconds ago. The last packet sent successfully to the server was 43,603,303 milliseconds ago. is longer than the server con
调试一个程序, 调试到一半, 下班回家, 程序卡在了某一行, 第二天早上回来一看, 发现了异常: Wed Sep :: GMT+: WARN: Establishing SSL connection ...
- 【异常】ser class threw exception: java.sql.SQLException: The last packet successfully received from the server was 39,444 milliseconds ago. The last
1 详细异常 ser class threw exception: java.sql.SQLException: The last packet successfully received from ...
- Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfu
SQL: Cannot create JDBC driver of class '' for connect URL 使用数据库数据源的web 项目,发布后,访问数据库500报错: 浏览器端: 控制台 ...
随机推荐
- python peewee
from peewee import MySQLDatabase, Model from peewee import CharField, IntegerField, BooleanField # 引 ...
- 文本超出换行添加white-space:wrap无效
场景描述: 在vue项目中,在Modal弹窗里面使用Form表单组件,然后在FormItem里面放一个div标签用来装文字内容.有时会出现内容超出Form表单宽度但是不换行的问题. 解决方法: 给di ...
- gitee下载项目
PS:如果直接在gitee仓库中选择下载zip,在本地打开项目后是不会与gitee远程库绑定的.如果要与远程库同步,需要选择克隆,同样的,本地需要先搭建好git环境. 1.在本地新建文件夹 2.在文件 ...
- Android 6.0动态添加权限(Finn_ZengYuan博客)
1,随着手机版本变高,各种权限也有所限制:以下代码可人性化添加动态权限: 权限工具类1,2,3,4: 1,FinnPermissionConfig.CLass package com.finn.too ...
- MySQL中的索引应用
1.什么是索引(Index)? 官方的定义是索引是一种数据结构,从生活的纬度上讲,假如将一本书比作成一张表,这本书的目录就是表中的索引(Index). 2.索引的优势和劣势? 优势:数据量比较大时,为 ...
- ORCAD中,怎么一次性去掉所有元器件下面的下划线呢
选择元器件,右键找到unset单击就可以去掉了
- YOLO v6:一个硬件友好的目标检测算法
本文来自公众号"AI大道理" YOLOv6 是美团视觉智能部研发的一款目标检测框架,致力于工业应用. YOLOv6支持模型训练.推理及多平台部署等全链条的工业应用需求,并在 ...
- ERA-Interim 的变量TCW和VIWV可降水量
可降水量(Precipitable water) 气象上有一个名词"可降水量"(Precipitable water),可以用来衡量大气的水含量. 其公式为 \(W=\frac{1 ...
- Android 内存优化浅析
一:内存占用几大要点 1,Object Cache:Image cache,single instance obj(重量级别,例如数据库连接obj,bitmap ref),Thread过多, 2,Vi ...
- Visual Studio常用的宏
$(SolutionDir) 表示获取解决方案文件.sln所在文件夹 $(ProjectDir 获取项目工程文件.vcxproj所在文件夹 $(Configuration) 获取编译后的Debug / ...