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)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 【异常】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 ...

  4. mysql异常 : The driver has not received any packets from the server.

    异常: 结论:域名写错了或报这个异常

  5. 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 ...

  6. The driver has not received any packets from the server

    解决方法: jdbc的url添加参数: jdbc.url=jdbc:mysql://localhost:3306/totosea?useUnicode=true&characterEncodi ...

  7. 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 ...

  8. 解决异常:“The last packet sent successfully to the server was 0 milliseconds ago. ”的办法

    出现异常"The last packet sent successfully to the server was 0 milliseconds ago."的大部分原因是由于数据库回 ...

  9. 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 ...

随机推荐

  1. Android-RecyclerView-Item点击事件设置

    在上一篇博客Android-RecylerView初识中提到,RecyclerView不再负责Item视图的布局及显示,所以RecyclerView也没有为Item开放OnItemClick等点击事件 ...

  2. COJ 0985 WZJ的数据结构(负十五)(限定区域不同数)

    传送门:http://oj.cnuschool.org.cn/oj/home/addSolution.htm?problemID=955 试题描述: CHX有一个问题想问问大家.给你一个长度为N的数列 ...

  3. Hadoop FileInputFormat实现原理及源码分析

    FileInputFormat(org.apache.hadoop.mapreduce.lib.input.FileInputFormat)是专门针对文件类型的数据源而设计的,也是一个抽象类,它提供两 ...

  4. Java中的局部代码块、构造代码块、静态代码块

    局部代码块: 作用:控制变量的生命周期: 在程序中,当我们已经使用完 x 后,并且在接下来的代码中,不会再用到x,那么就没必要让x 在内存中占用空间了,这用情况下,可以使用 局部代码块,将x及其所设计 ...

  5. sqlserver2012的审计功能的相关理解

    1.sqlserver2012可以做实例的审计,以及数据库的审计,基本包括了所有的操作.可以符合我们的要求.   2.审计功能需要实例级别的配置数据库级别的配置,实例上建立“审核”,数据库上建立“数据 ...

  6. Java IO详解(转)

    IO是Java及众多编程语言很重要的一块,同时很多程序的瓶颈和耗时操作也都在IO这块. 一.简介 IO操作面临很多问题,信息量的巨大,网络的环境等等,因为IO不仅仅是对本地文件.目录的操作,有时对二进 ...

  7. PHP常用封装类

    1.mysql.class.php <?php // namespace Package; /** * MySQL 类 * @author cxm <tsai.er6@gmail.com& ...

  8. Drupal 实战

    <Drupal 实战> 基本信息 作者: 葛红儒    丛书名: 实战系列 出版社:机械工业出版社 ISBN:9787111429999 上架时间:2013-6-28 出版日期:2013 ...

  9. SKScene类

    继承自 SKEffectNode:SKNode:UIResponder:NSObject 符合 NSCoding(SKNode)NSCopying(SKNode)NSObject(NSObject) ...

  10. JNI- java.lang.UnsatisfiedLinkError: Native method not found

    http://stackoverflow.com/questions/24566127/jni-java-lang-unsatisfiedlinkerror-native-method-not-fou ...