赞
踩
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 11,226 milliseconds ago.
Caused by: java.net.SocketException: Connection reset by peer: socket write error
两种解决异常:“The last packet successfully received from the server was 11,226 milliseconds ago. ”的办法
出现异常”The last packet successfully received from the server was 11,226 milliseconds ago. “的大部分原因是由于数据库回收了连接,而系统的缓冲池不知道,继续使用被回收的连接所致的。
以mysql为例:
单位是秒,最大好像是24天:
[mysqld]
wait_timeout=86400
interactive_timeout=86400
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。