java mysql The last packet sent successfully to the server was 0 milliseconds ago.


2016年9月27日19:07:19


[ERROR]The last packet sent successfully to the server was 0 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

 解決方法:

(1)使用JDBC URL中使用autoReconnect屬性,url添加&autoReconnect=true&failOverReadOnly=false&maxReconnects=10

(2) 修改MySQL的參f 添加[mysqld]wait_timeout=31536000 interactive_timeout=31536000

(3)重啓mysqlservice mysql restart原因分析:

(1)大量數據訪問情況下,mysql connection連接有可能失效

(2)長時間不妨問,connection會失效

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章