Idea中Spring Boot 启动出错

Description: Failed to auto-configure a DataSource: 'spring.datasource.url'
Consider the following:
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).

 

解决办法:

一、启动类添加:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

二、启动类添加第二种:

@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)

 

posted @ 2018-10-22 15:35  十月要努力丫  阅读(907)  评论(0编辑  收藏  举报