使用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.