The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (关于jdbc)
The last packet sent successfully to the server was milliseconds ago. The driver has not received any packets from the server.
今天操作数据库较大数据库访问量的时候出现问题,大致是数据库连接缓冲池的问题,弄了半天的mysql (ubuntu)。
解决办法:
(1)使用JDBC URL中使用autoReconnect属性,url添加
&autoReconnect=true&failOverReadOnly=false
例如:
String URL = "jdbc:mysql://localhost:3306/mxManage&autoReconnect=true&failOverReadOnly=false";
(2) 修改MySQL的参数. /etc/my.cnf 添加
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000
(3)重启mysql
service mysql restart
原因分析:
(1)大量数据访问情况下,mysql connection连接有可能失效
(2)长时间不妨问,connection会失效
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (关于jdbc)的更多相关文章
- The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
今天项目中报了如下错误 The last packet sent successfully to the server was 0 milliseconds ago. The driver has n ...
- Communications link failure;;The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure::The ...
- 【异常】The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
1 详细异常信息 The last packet sent successfully to the server was milliseconds ago. The driver has not re ...
- mysql异常 : The driver has not received any packets from the server.
异常: 结论:域名写错了或报这个异常
- MySql8.0数据库链接报错The driver has not received any packets from the server
1.我使用MySql数据库8.0版本,然后驱动改成了 jdbc.driver=com.mysql.cj.jdbc.Driver jdbc.url=jdbc:mysql://127.0.0.1:3306 ...
- The driver has not received any packets from the server
解决方法: jdbc的url添加参数: jdbc.url=jdbc:mysql://localhost:3306/totosea?useUnicode=true&characterEncodi ...
- The last packet sent successfully to the server was 0 milliseconds ago.[nutch---mysql ]
今天在使用JDBC操作mysql时遇到下面的异常信息: 引用 The last packet sent successfully to the server was 0 milliseconds ag ...
- 解决异常:“The last packet sent successfully to the server was 0 milliseconds ago. ”的办法
出现异常"The last packet sent successfully to the server was 0 milliseconds ago."的大部分原因是由于数据库回 ...
- 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 ...
随机推荐
- 动态树LCT
#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> usin ...
- Java 8 Lambda 揭秘
再了解了Java 8 Lambda的一些基本概念和应用后, 我们会有这样的一个问题: Lambda表达式被编译成了什么?. 这是一个有趣的问题,涉及到JDK的具体的实现. 本文将介绍OpenJDK对L ...
- bin
动态链接库(Dynamic Link Library或者Dynamic-link library,缩写为DLL),是微软公司在微软视窗操作系统(即Windows操作系统)中实现共享函数库概念的一种方式 ...
- jenkins服务器安装
http://www.360doc.com/content/13/0412/09/10504424_277718090.shtml
- APP开发者到期续费说明
几步搞明白APP开发者续费,不再苦恼.1.APP开发者账号快满一年时,注册邮箱会收到一封提醒续费的邮件.主题类似5 days left to renew your iOS Developer Prog ...
- [转] Transitions: Going from Shots to the Insulin Pump
Part three of our article series on the common phases of type 2 diabetes management By Lance Porter ...
- [转] 使用Spring Boot和Gradle创建项目
Spring Boot 是由 Pivotal 团队提供的全新框架,其设计目的是用来简化新 Spring 应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的 ...
- Qt Linux 使用QJson库
1. 下载 到http://dl.oschina.net/soft/qjson下载库源文件: qjson-0.8.1-1385961227890.zip 解压为:qjson-0.8.1 2. 编译 c ...
- 应用框架 ViewPager Tab Fragment SlidingMenu
介绍 常见的应用框架 框架一:多个tab+Fragment,点击不同的tab加载不同的Fragment,不能滑动切换只能点击切换: 框架二:多个tab+ViewPager+FragmentPagerA ...
- 织梦DEDECMS {dede:field name='position'/}标签增加其它属性的
在默认情况下,织梦(DedeCms)系统当前位置的调用标签为: {dede:field name='position'/} 在这种默认的情况下,生成后的代码大致为如下格式: 主页 > 应用软件 ...