Last packet sent to the server was 0 ms ago 解决办法
来源:互联网 发布:2016年淘宝刷单有用吗 编辑:程序博客网 时间:2024/05/21 19:31
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5215)
at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:331)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:317
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:91)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransac
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspe
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
解决办法:
因为MySQL默认的空闲等待时间是8个小时,一旦空闲超过8个小时,就会抛出异常。异常文本如下:
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Software caused connection abort: socket write error
解决方式:编辑mysql目录里的:my.cnf(windows下为my.ini),将超时时间设置为10年,在[mysqld]后面加入:
wait_timeout=315360000
然后重启MySQL
# service mysql restart
- Last packet sent to the server was 0 ms ago
- Last packet sent to the server was 0 ms ago
- Last packet sent to the server was 0 ms ago 解决办法
- 关于Communications link failure Last packet sent to the server was 0 ms ago.的解决办法
- Communications link failure Last packet sent to the server was 0 ms ago
- mysql Last packet sent to the server was 0 ms ago.
- Communications link failure Last packet sent to the server was 0 ms ago.问题解决
- TOMCAT启动时报:Last packet sent to the server was 0 ms ago
- linux 修改mysql 报错: Last packet sent to the server was 0 ms ago
- Last packet sent to the server was 0 ms ago服务器报错
- The last packet sent successfully to the server was 0 milliseconds ago. 的解决办法
- sqoop mysql Last packet sent to the server was 1 ms ago
- mysql Communications link failure Last packet sent to the server was X ms ago
- mysql Communications link failure Last packet sent to the server was X ms ago
- mysql Communications link failure Last packet sent to the server was X ms ago
- 数据库链接报异常Communications link failure.Last packet sent to the server was 0 ms ago.
- The last packet sent successfully to the server was 0 milliseconds ago. The
- [Java] 解决异常:“The last packet sent successfully to the server was 0 milliseconds ago.
- 网络水军是什么意思
- LINUX下双网卡绑定
- Android多分辨率和多屏幕的布局适配详解
- 第10部份:文件导入
- 康奈尔大学做笔记的方法,从此学习工作效率提高100%
- Last packet sent to the server was 0 ms ago 解决办法
- Windchill中Ghost Object的处理
- NTP时间同步
- ContextLoaderListener作用详解
- Android 图片异步加载,延时加载的一些思路
- 市场购物篮分析
- uboot烧写yaffs2过程中,如何写入oob数据的
- 2012年11月编程排行榜:C#一路下跌
- 《转》32位机和64位机下面各类型sizeof的大小