济南刘振 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 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题