【报错】Failed to determine a suitable driver class

文章目录

  • 是否需要mybatis依赖:不需要排除
  • resources未编译

报错信息


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

导入依赖有:

        <dependency>
            <groupId>com.baomidougroupId>
            <artifactId>mybatis-plus-boot-starterartifactId>
            <version>3.4.1version>
        dependency>
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>8.0.17version>
        dependency>

是否需要mybatis依赖:不需要排除

是否需要mybatis依赖:不需要排除即可

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

【报错】Failed to determine a suitable driver class_第1张图片

resources未编译

启动失败 Failed to determine a suitable driver class 问题解决方案

你可能感兴趣的:(Spring,Boot,java)