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
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!