Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
启动SpringBoot报上面这个错误。
原因: Failed to determine a suitable driver class
我的解决方式:将POM依赖中的
这三个依赖注释掉,然后重新加载一下maven依赖
重新启动就不报错了。
另外两种方法:
1、在application.yml中添加datasource配置
2、在启动类中修改注解
如上图,在@SpringBootApplication后面加上 (exclude = {DataSourceAutoConfiguration.class})