SpringBoot启动报错
时间:2020-04-07 10:50:06
收藏:0
阅读:72
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).
启动报错的原因是springboot默认启动的时候会去找数据库的配置文件,而我们没有相应的数据库配置
解决方案:
方案1.添加数据库配置(在application.yml中)
方案2.在启动类的注解上添加参数,默认不去加载数据库配置(推荐)----将红色划线部分添加到注解中
原文:https://www.cnblogs.com/leeeeemz/p/12651702.html
评论(0)