問題描述:
springboot版本 2.1.1
pom.xml配置
application.properties
在配置數據連接的時候報如下錯誤:
> Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could
這是因為引入的spring-boot-starter-jdbc但是沒有配置spring.datasource.url等信息報錯的。(在我的application.properties中采用的hikari作為數據庫連接)
解決辦法:
第一種:
將配置信息改為:
第二種:(去掉DataSourceAutoConfiguration的自動配置)
微信公眾號