济南刘振 2018-11-08 02:41 采纳率: 0%
浏览 2089

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 2019-07-16 09:17
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算