1、问题描述?
springboot工程启动的时候报错信息如下
Description:
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
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
2、创建问题机解决方案
2.1、yml文件被排除
你的yml文件被排除,加载的时候会出现类似的问题,去除pom.xml文件中类似下面的操作
<excludes>
<exclude>**/*.yaml</exclude>
</excludes>
2.2、不需要使用数据库确加载了数据库的包
有些项目我们不需要使用mysql等数据库,但是加载了数据库的包
去除对应的mysql和mybatis/mybatis-plius等相关包即可。
2.3、加载了包,但是没有配置数据库配置文件或格式不对
数据库连接需要配置数据库配置,以及正确的格式。如下正确配置
注意缩进<

最低0.47元/天 解锁文章
24万+

被折叠的 条评论
为什么被折叠?



