0


springboot项目禁用dataSource数据源功能,只需修改yml文件,关闭数据库连接功能

当我们遇到以下报错:

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).

如果不想使用数据库功能,可以这样配置:

application.yml:

spring:
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration

本文转载自: https://blog.csdn.net/weixin_44853310/article/details/135339989
版权归原作者 ThatMonth 所有, 如有侵权,请联系我们删除。

“springboot项目禁用dataSource数据源功能,只需修改yml文件,关闭数据库连接功能”的评论:

还没有评论