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.

今天操作数据库较大数据库访问量的时候出现问题,大致是数据库连接缓冲池的问题,弄了半天的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会失效

时间: 2024-10-09 20:38:56

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

? 版权声明:本文为博主原创文章,转载请注明出处 1.问题描述 搭建SSH框架,启动时报错如下: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.GeneratedConstructorAccessor17.newInstance(Unknown Source

he 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 not received any packets from the server. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.new

The last packet sent successfully to the server was 0 milliseconds ago

出现异常”The last packet sent successfully to the server was 0 milliseconds ago.“的大部分原因是由于数据库回收了连接,而系统的缓冲池不知道,继续使用被回收的连接所致的. 以mysql为例: 第一种解决办法,就是将mysql回收空闲连接的时间变长,mysql默认回收时间是8小时,可以在mysql目录下的my.ini中增加下面配置,将时间改为1天. 单位是秒,最大好像是24天: [mysqld] wait_timeout=864

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 20,519 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds

ArcGIS Server 10.0 安装及使用完整攻略

引言 ArcGIS Server 10.0在使用和安装的过程中,需要进行比较全面的学习,才能正确使用.缺乏正确的指引,用户很容易在安装及使用中遇到问题.所以笔者在此总结Server 10.0的安装及使用中需要参考的资源.提供适当的教程,并对可能出现的问题进行解释,可供一些可行的解决方案.有兴趣做好Server 10.0工作的笔者,请耐心阅读本文.笔者花了近一个星期的时间研究ArcGIS Server 10.0的使用,希望对后来者能有所帮助. 安装 Server 10.0的安装前,建议在本机安装一

mysql重连,连接丢失问题:The last packet sent successfully to the server was……

1.log错误日志: -org.hibernate.exception.JDBCConnectionException: The last packet successfully received from the server was 51,999,860 milliseconds ago. The last packet sent successfully to the server was 51,999,860 milliseconds ago. is longer than the se

MySQL Server 5.0–安装及配置/MySQLInstanceConfig.exe用法详解

MySQL Server 5.0–安装及配置/MySQLInstanceConfig.exe用法详解 http://blog.csdn.net/feihong247/article/details/7791105 配置MySQL步骤: 1.       运行MySQL Server安装目录下bin/MySQLInstanceConfig.exe.出现如下所示的向导界面 . 点击"Next"进入下一步. 2.       如果MySQLInstanceConfig在MySQL Serve

Adobe/Flash Media Server 5.0 linux 64位系统下的安装

一.下载 Adobe/Flash MS5.0下载地址: http://fs1.d-h.st/download/00036/VOt/adobemediaserver_5_ls1_linux64.tar.gz # ./wget http://fs1.d-h.st/download/00036/VOt/adobemediaserver_5_ls1_linux64.tar.gz 二.安装 # ./tar -xvf adobemediaserver_5_ls1_linux64.tar.gz # ./cd

CentOS 7上安装Zabbix Server 3.0 图文详解

转载自 http://www.linuxidc.com/Linux/2016-09/135204.htm CentOS 7上安装Zabbix Server 3.0 图文详解 1.查看系统信息. cat /etc/RedHat-releaseCentOS Linux release 7.0.1406 (Core) uname -a Linux VM_96_155_centos3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_