property ‘spring.datasource.timeBetweenEvictionRunsMillis‘"/>
Cannot resolve configuration property ‘spring.datasource.timeBetweenEvictionRunsMillis‘
springboot yml 配置问题如图
正常配置 druid
spring:profiles:active: devdatasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:4406/demo?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=trueusername: rootpassword: roottype: com.alibaba.druid.pool.DruidDataSourcedruid:initialSize: 5minIdle: 5maxActive: 10maxWait: 60000 #获取连接时最大等待时间,单位毫秒timeBetweenEvictionRunsMillis: 1800000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒filters: stat,wall,slf4j #通过别名的方式配置扩展插件,常用的插件有:监控统计用的filter:stat,日志用的filter: slf4j,防御sql注入的filter:wallconnectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=90;druid.stat.logSlowSql=true # 通过connectProperties属性来打开mergeSql功能;慢SQL记录validationQuery: select 'x' #用来检测连接是否有效的sql,要求是一个查询语句testWhileIdle: true #建议配置为true,不影响性能,并且保证安全性。如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。testOnBorrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能testOnReturn: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能poolPreparedStatements: false #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭
解决问题
更多推荐
Cannot resolve configuration property ‘spring.datasource.timeBetweenEvictionRuns
发布评论