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. Java Tomcat SSL 服务端/客户端双向认证

    借花献佛:http://www.blogjava.net/icewee/archive/2012/06/04/379947.html

  2. BZOJ1711: [Usaco2007 Open]Dingin吃饭

    1711: [Usaco2007 Open]Dingin吃饭 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 508  Solved: 259[Submit ...

  3. 错误 1 未能找到元数据文件“C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/wwwroot/7cb4fcd

    错误 1 未能找到元数据文件“C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/wwwroot/7cb4fcd ...

  4. cryptopp开源库的使用(二):base64加密

    很多时候我只是优秀工具的使用者,优秀的工具用好了才能发挥作用 最近使用cryptopp的base64对压缩后的zip文件内容进行加密遇到了问题. 首先zip压缩没问题,可是最后得到的base64字符串 ...

  5. python模块管理

    参考python的模块管理,请看如下 http://blog.sina.com.cn/s/blog_90bc5fc6010159e0.html http://hi.baidu.com/billsche ...

  6. 使用 Maven 部署 artifact 到 Nexus 教程

    本文侧重讲解如何将已经按照好的 Maven 和 Nexus 连接,即如何通过 Maven 部署 artifact 到 Nexus. 本文前提: 1. 安装好 Maven.可以使用 Maven 创建.打 ...

  7. SRM468 - SRM469(1-250pt, 500pt)

    SRM 468 DIV1 250pt 题意:给出字典,按照一定要求进行查找. 解法:模拟题,暴力即可. tag:water score: 0.... 这是第一次AC的代码: /* * Author: ...

  8. C++ STL之pair常用指令

    只记载本人在ACM中常用的函数. pair<first, second>,将两个数据组合成一个数据.在其他stl(如map),函数需要传回两个值时可能会用到. 1.初始化 #include ...

  9. SCOPE 中 SPFILE、MEMORY、BOTH 的小小区别

    ALTER SYSTEM 中 SCOPE=SPFILE/MEMORY/BOTH 的区别: SCOPE = SPFILE The change is applied in theserverparame ...

  10. C++[类设计] ini配置文件读写类config

      //in Config.h #pragma once #include <windows.h> #include <shlwapi.h> #pragma comment(l ...