访问mysql过程中会突然出现 异常日志一: DruidPooledStatement errorCheck:CommunicationsException,druid version 1.1.23 然后报出异常日志二: discard connection com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 5,538,582 milliseconds ago. The last packet sent successfully to the server was 5,538,582 milliseconds ago. …… Caused by: java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115)
后续有请求还偶尔报出 Cause: java.sql.SQLException: connection disabled ; uncategorized SQLException; SQL state [null]; error code [0]; connection disabled; nested exception is java.sql.SQLException: connection disabled at …… Caused by: java.sql.SQLException: connection disabled at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1169) at …… Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 5,538,582 milliseconds ago. The last packet sent successfully to the server was 5,538,582 milliseconds ago. …… Caused by: java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115) at ……
配置: spring: datasource: druid: max-active: 10 min-idle: 0 max-wait: 5000 validation-query: select 1 testOn-borrow: true