1,问题现象:
com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was58129 seconds ago.The last packet sent successfully to the server was 58129 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
解决办法:
(备注:mysql5以上的,设置autoReconnect=true 是有的 ,起作用)
看看官网 mysql8.0上关于 autoReconnect的设置:https://dev.mysql.com/doc/refman/8.0/en/c-api-auto-reconnect.html
he MySQL client library can perform an automatic reconnection to the server if it finds that the connection is down when you attempt to send a statement to the server to be executed. If au