1.增加一个配置
#下面这两个配置,可以在每次连接的时候判断一些连接是否有效
spring.datasource.druid.test-on-borrow=true
spring.datasource.druid.test-while-idle=true
参考:
解决:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure(真实有效)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)