spring boot启动失败Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd...

spring boot 启动失败 Failed to configure a DataSource: ‘url’ attribute is not specified and no embedd…

解决方案1:
首先看加载资源的MySQL驱动是否有问题
在这里插入图片描述
特别需要注意你的resource文件
在这里插入图片描述
需要修改文件类型
在这里插入图片描述
这样子就
这样子就启动完成啦。
解决方案2:
jar包冲突的缘故
在这里插入图片描述
把JDBC的jar包删除或者注释掉
在注解上加配置
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class })

猜你喜欢

转载自blog.csdn.net/qq_45498460/article/details/111150841