Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could

启动springboot报这个错,找不到数据源配置。

这个问题有几种可能:

一是配置的地方写错了(我就是写成了devi,多打了一个i找不到):

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could

二是没有配置数据库连接启动报错,可以通过取消自动数据源自动配置来解决

  在启动项加上这个

@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)
@SpringBootApplication