SpringBoot, shardingsphere, 用Druid做连接池,启动一直报错:

Description:

Failed to configure a DataSource: 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.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>

正确引入方式:

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐