启动类新增
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
application.yml
server: port: 8080 servlet: session: timeout: 7200 spring: datasource: url: jdbc:mariadb://10.157.171.89:3306/dataindex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false username: root password: 123456 driver-class-name: org.mariadb.jdbc.Driver
修改后
server: port: 8080 servlet: session: timeout: 7200 spring: redis: host: 10.157.144.252 port: 5379 password: DtDream0209@HangZhou config : maxTotal: 100 maxIdle: 10 maxWaitMillis : 100000
pom.xml中新增
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>