com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
来源:互联网 发布:手机阿里云登录 编辑:程序博客网 时间:2024/06/09 15:04
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
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:3170)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1316)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1235)
at AerchiTask.DBTool.insert_SinaWeibo_ArticleToDB(DBTool.java:105)
at AerchiTask.WeiBoArticle.getArticleList(WeiBoArticle.java:453)
at AerchiTask.WeiBoArticle.main(WeiBoArticle.java:182)
** END NESTED EXCEPTION **
Last packet sent to the server was 1 ms ago.
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
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:3170)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1316)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1235)
at AerchiTask.DBTool.insert_SinaWeibo_ArticleToDB(DBTool.java:105)
at AerchiTask.WeiBoArticle.getArticleList(WeiBoArticle.java:453)
at AerchiTask.WeiBoArticle.main(WeiBoArticle.java:182)
** END NESTED EXCEPTION **
Last packet sent to the server was 1 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:3170)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1316)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1235)
at AerchiTask.DBTool.insert_SinaWeibo_ArticleToDB(DBTool.java:105)
at AerchiTask.WeiBoArticle.getArticleList(WeiBoArticle.java:453)
at AerchiTask.WeiBoArticle.main(WeiBoArticle.java:182)
7 | current Time is : 16:01:01
------------------------------------------------------------------------------
- AutoReconnect
Add this code to your connection string:
&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
原因分析:
(1)大量数据访问情况下,mysql connection连接有可能失效
(2)长时间不妨问,connection会失效
关于MySQL的wait_timeout连接超时问题报错解决方案
Mysql服务器默认的“wait_timeout”是8小时【也就是默认的值默认是28800秒】,也就是说一个connection空闲超过8个小时,Mysql将自动断开该connection,通俗的讲就是一个连接在8小时内没有活动,就会自动断开该连接。 wait timeout的值可以设定,但最多只能是2147483,不能再大了。也就是约24.85天
所以即使你MySQL通过my.ini 在
# The TCP/IP Port the MySQL Server will listen on port=3306下面添加
# this is myown dinifition for mysql connection timeout wait_timeout=31536000
interactive_timeout=31536000
无论超过最大限度多大的数值,只能被MySQL解析为2147483,2147483天后你的程序该出什么错还是什么错,避免不了
更多参考:
http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#dynamic-system-variables
http://www.blogjava.net/heweiya/archive/2006/01/18/28483.html
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:的解决
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- 关于com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:的解决
- 如何解决com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception
- 遭遇com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying
- Cause: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying...的解决
- Error: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying except
- Communications link failure due to underlying exception
- Communications link failure due to underlying exception
- Communications link failure due to underlying exception:
- Mysql报错!Communications link failure due to underlying exception
- SSH,POP,FTP,telent
- 【设计模式】对象的克隆-原型模式
- ZOJ1101-Gamblers 终于AC。。。
- AngularJS的应用(4)
- 关于四位计数器的设计,阻塞式与非阻塞式赋值引发的问题
- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
- 根据UILable高度让UITableViewCell自动适应高度
- ZOJ 3323Somali Pirates
- winfrom中出现" 配置系统未能初始化"
- Android中Parcelable接口用法
- 第一章
- window是系统杀死8080端口的线程
- JavaScript 数据结构
- sqlite错误 The database disk image is malformed database disk image is malformed 可解决