1.检查application.yml中数据库配置是否有误
2.检查pom.xml中是否引入
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </dependency>
没有的话加上
3.检查入口Application中是否有注解
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
有的话红色部分删掉