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 ...
随机推荐
- 转:implementing cons/car/cdr without explicit storage
I know this is old wine but it’s just too cool! It elegantly demonstrates closure and higher-order f ...
- Extjs4 中在指定光标处插入值
var rulearea = Ext.getCmp(文本域Id); var rulevalue = rulearea.getValue();// 获取文本textarea 里面的值 var start ...
- GruntJs安装及使用入门(自定义grunt任务,合并压缩js、css)
一.Grunt.js简介(实现自动化) 1)简要说明: 1.GruntJs是基于node的javascript命令行工具,可以自动化构建.测试.生成文档的项目管理工具: 2.使用GruntJs可以自动 ...
- Delphi TcxTreeList 读取 TcxImageComboBoxItem类型的值
Delphi TcxTreeList 读取 TcxImageComboBoxItem类型的值: Node.Values[wiNodeLevel.ItemIndex]://值 Node.Texts[ ...
- 挂载nfs系统问题之: Root-NFS: Server returned error -13 while mounting
今天换了个路由器,由于是自动分的IP,现在的IP和之前的不在同一网段.以前是192.168.0.xxx,现在是192.168.1.xxx.本以为将serverip,ipaddr,bootargs这些参 ...
- Appcelerator Titanium 3.x Win7 64位平台安装步骤
刚接触Android移动开发,第一次下载Titanium,第一次下载ADT,第一次看Javascript代码,N多第一次...... 慢慢摸索了一个礼拜把移动开发的工具链的配置学习了一下,抛砖引玉,但 ...
- Thinkpad Edge E440 Ubuntu14.04 无线网卡驱动 解决
http://ubuntuforums.org/showthread.php?t=2190347 正文: Thinkpad Edge E440 安装 Ubuntu12.04 后 无法使用无线网卡, 须 ...
- PHP5.4新特性(转)
PHP5.4正式前两天发布了,之前有看了一些PHP5.4主要特性相关文章,因此在这里小结一下. 其中好几点更新是由Laruence贡献的!本文部分内容也是源自Laruence的博客. 1. Buid- ...
- TinyXml快速入门(二)
在<TinyXml快速入门(一)>中我介绍了使用TinyXml库如何创建和打印xml文件,下面我介绍使用tinyxml库对xml文件进行一系列的操作,包括获取xml文件声明,查询指定节点. ...
- ubuntu下mysql中文乱码问题
本来就是想弄个网页往数据库里添加数据的,然后就发现了mysql的中文乱码问题,弄了半天解决方法如下: 首先停mysql服务,编辑配置文件my.cnf $ sudo stop mysql $sudo v ...