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

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>
posted @ 2022-10-04 00:13  IT情深  阅读(103)  评论(0编辑  收藏  举报