您当前的位置: 首页 >  sql

科技D人生

暂无认证

  • 0浏览

    0关注

    1550博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Mysql学习总结(62)——MySQL连接com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link问题

科技D人生 发布时间:2018-10-22 17:23:16 ,浏览量:0

数据库出现如下连接问题

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

解决

Mysql服务器默认的“wait_timeout”是8小时,也就是说一个connection空闲超过8个小时,Mysql将自动断开该connection。这就是问题的所。将会造成上面的异常。 set global wait_timeout=604800;  set global interactive_timeout=604800; 输入以上两句就可以解决这个问题了

关注
打赏
1662604032
查看更多评论
立即登录/注册

微信扫码登录

0.1565s