关于报错If you have database settings to be loaded from ...

今天配置分页后启动项目报错

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

随后检查yml文件的配置发现没有配置出问题,查看资源后,看到一条

需要在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude = {DataSourceAutoConfiguration.class},排除此类的autoconfig

遂尝试了一下,发现没有报错了

 

posted @ 2022-11-01 11:42  93丶Fss  阅读(824)  评论(0)    收藏  举报