`
kalllx
  • 浏览: 63005 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

解决MySQL连接超时Communications link failure due to underlying exception

 
阅读更多
解决MySQL连接超时Communications link failure due to underlying exception
2008-04-10 23:04

最近在用一个MySQL的Java连接池的过程中,连接一晚上不释放,第二天就会造成超时的错误,查了一下原因,原来是因为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

解决方式:编辑/etc/my.cnf(windows下为my.ini),将超时时间设置为10年,在[mysqld]后面加入:
wait_timeout=315360000

然后重启MySQL
# service mysql restart

搞定。然后重启超时的java连接池程序吧。

 

分享到:
评论

相关推荐

    mysql 异常com.mysql.jdbc.CommunicationsException

    本次异常的具体描述为:“Communications link failure due to underlying exception: **BEGINNESTED EXCEPTION** java.io.EOFException STACK TRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully...

    浅析mysql交互式连接&非交互式连接

    这可能导致应用程序在尝试使用这些已断开的连接时遇到“Communications link failure due to underlying exception”异常。 解决这个问题的方法通常包括以下几点: 1. 调整`wait_timeout`值,增加到更长的时间,以...

    JDBC 程序的常见错误及调试方法

    错误信息可能表现为“***municationsException: Communications link failure due to underlying exception”以及一个***.ConnectException异常。这通常意味着无法建立到数据库服务器的网络连接。解决方法是确认IP...

    mysql密码过期导致连接不上mysql

    mysql密码过期了,今天遇到了连接mysql,总是连接不上去, 错误现象1: An attempt by a client to checkout a Connection has timed out 第一次出现连接超时错误,第一反应是去修改cpool.checkoutTimeout参数为...

    Arcgis连接 postgresql sde 时遇到的问题以及解决办法

    通过以上步骤,大多数连接问题都能得到解决。但若问题仍然存在,可能需要进一步排查硬件配置、网络连接或特定的数据库设置。记住,及时查阅官方文档和社区论坛,通常能找到更多针对性的解决方案。

    解决Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

    Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException The last packet successfully received from the server was 47,795,922 ... The last packet sent successfully to the server was 47,795,922

    Introduction to Computing Systems From bits & gates to C & beyond

    Patt'Introduction to Computing Systems: From bits & gates to C & beyond', now in its second edition, is designed to give students a better understanding of computing early in their college careers in...

    A Practical Guide to Designing with Data.pdf

    new ʻvisualizationsʼ are an attempt to explain the underlying information with a powerful visual impact. They take complex ideas and distil them into beautiful graphics revealing the ...

    LTE-Advanced: A Practical Systems Approach to Understanding 3GPP LTE

    It includes methodologies and results related to link-level and system-level evaluations of LTE-Advanced. It provides understanding and insight into the advanced underlying technologies in LTE-...

    An Introduction to Fluid Dynamics (Batchelor)

    This book gives an excellent introduction to fluid dynamics First published in 1967, Professor Batchelor's classic work is still one of the foremost texts on fluid dynamics. His careful presentation ...

    计算机网络第六版答案

    but the time when loss first occurs will be different from one experiment to the next due to the randomness in the emission process. 22. Five generic tasks are error control, flow control, ...

    有关数据库连接的问题

    ### 有关数据库连接的问题 #### 关于MyEclipse连接SQL Server 的问题 在进行Web开发时,经常需要处理与数据库的交互。对于使用MyEclipse作为集成开发环境(IDE)的开发者来说,如何顺利地连接到SQL Server数据库是...

    Sparse channel estimation in millimeter wave communications

    an underlying two-dimensional cluster feature, we propose a two-dimensional sparse Bayesian learning method without a priori knowledge of two-dimensional angular spread patterns. It essentially ...

    Introduction to Matplotlib.rar

    Visualizing data in plots and figures exposes the underlying patterns in the data and provides insights. Good visualizations also help you communicate your data to others, and are useful to data ...

    A Brief Review of ChatGPT: Its Value and the Underlying GPT Tech

    A Brief Review of ChatGPT: Its Value and the Underlying GPT TechnologyA Brief Review of ChatGPT: Its Value and the Underlying GPT TechnologyA Brief Review of ChatGPT: Its Value and the Underlying GPT ...

Global site tag (gtag.js) - Google Analytics