初次使用spring boot,启动时去出现了以下错误:
Failed to configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.
Reason: Failed to determine a suitable driver class
思考:
本来是按照入门教程来做的项目,但因为心急,所以在刚开始勾选时,将SQL中的MySQL和mybaits也勾选了,可能是没有配置数据库而引起的问题。
解决方法:
在网上寻找后,得到解决方法:
在@SpringBootApplication后添加(exclude=DataSourceAutoConfiguration.class),并导入相关类即可正常启动。