数据库连接没配置或者配置错了,检查application.yml文件或者application-dev.yml文件
appliction.yml
spring:
profiles:
active: dev
appliction-de.yml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/epidemic_prevention_manage?characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8&&useUnicode=true
username: root
password: 123456
还有一种方法是自动配置数据源在启动类上加上这个注解
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)