问题现象:
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.
解决办法:
mysql4.x版本 设置autoReconnect=true
mysql5以上的,修改my.ini配置文件,在mysqld下面添加以上两行,后面的数字是时间
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000