使用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.
请问解决了吗,我也碰到这个问题,经测试,是多数据源配置的问题,去掉多数据源就可以了