u013549463
King-liu
采纳率0%
2018-11-08 02:41 阅读 2.0k

spring boot多数据源 mysql8+超时问题

使用spring boot2.0.3,加druid配置多数据源,配置了testWhileIdle和timeBetweenEvictionRunsMillis,
超过mysql的time_out 时间时,代码还会报错

            com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 401,266 milliseconds ago.  The last packet sent successfully to the server was 401,270 milliseconds ago. 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.
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • qq_32506297 qq_32506297 2019-07-16 09:17

    请问解决了吗,我也碰到这个问题,经测试,是多数据源配置的问题,去掉多数据源就可以了

    点赞 评论 复制链接分享

相关推荐