當使用springboot開發使用的時候,不想配置數據庫配置的時候,啓動類頭部聲明就可以了:
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
當啓動出現這個錯誤的時候
Failed to configure a DataSource: 'url' attribute is not specified and no embedd
原因可能是數據庫連接沒有配置,可以配置上對應的數據庫鏈接信息,也可以使用這個方法