zl程序教程

您现在的位置是:首页 >  工具

当前栏目

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could

Failed to not and is No url could
2023-09-11 14:15:13 时间

springboot中如果在项目pom引入了SpringBoot集成mybatis框架的依赖,就必须要配置数据库连接信息,否则启动就会报错,错误如下:

***************************
APPLICATION FAILED TO START
***************************

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

 

去除pom中相关依赖即可

        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.1.4</version>
        </dependency>