【异常】SpringBoot3.2.0 Description: Failed to configure a DataSource: ‘url‘ att

mybatisPlus 多数据源导致

异常

复制代码
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 (the profiles dev are currently active).

解决

spring-boot 1.5.x 2.x.x

复制代码
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
  <version>${version}</version>
</dependency>

spring-boot3 使用以下依赖

复制代码
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
  <version>${version}</version>
</dependency>
相关推荐
Chan165 小时前
热点数据自动缓存方案:基于京东 Hotkey 实践
java·数据库·redis·mysql·spring·java-ee·intellij-idea
Leisure -_-5 小时前
Oracle Database 26ai Free 安装讲解
数据库·oracle
i***71955 小时前
如何查看PostgreSQL的版本
数据库·postgresql
妮妮喔妮6 小时前
pai 的redis存储
数据库·redis·缓存
SelectDB6 小时前
Apache Doris AI 能力揭秘(三):AI_AGG 与 EMBED 函数深度解析
数据库·后端·apache
普通网友6 小时前
用Python批量处理Excel和CSV文件
jvm·数据库·python
y***61316 小时前
在Spring Boot项目中使用MySQL数据库
数据库·spring boot·mysql
ApacheSeaTunnel6 小时前
(四)收官篇!从分层架构到数据湖仓架构系列:数据服务层和数据应用层及湖仓技术趋势小结
数据库·开源·数据湖·技术分享·白鲸开源
艾斯比的日常6 小时前
MySQL 锁机制深度解析:从原理到实践
数据库·mysql
Starduster7 小时前
一次数据库权限小改动,如何拖垮半个互联网?——Cloudflare 2025-11-18 大故障复盘
数据库·后端·架构