【异常】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>
相关推荐
zzh08110 小时前
数据库初识与安装
数据库
m0_7380980210 小时前
使用Python操作文件和目录(os, pathlib, shutil)
jvm·数据库·python
AI成长日志10 小时前
【实用工具教程】数据库基础操作实战:SQLite/MySQL连接、CRUD操作与查询优化
数据库·mysql·sqlite
l1t10 小时前
DeepSeek总结的 DuckDB 1.5 功能亮点
数据库·sql·duckdb
Bdygsl10 小时前
MySQL(4)—— 表设计
数据库·mysql
2301_8194143010 小时前
使用Python进行图像识别:CNN卷积神经网络实战
jvm·数据库·python
未来龙皇小蓝11 小时前
【MySQL-索引调优】09:Order By相关概念
数据库·mysql·性能优化
未来龙皇小蓝11 小时前
【MySQL-索引调优】10:常见的分页优化处理
数据库·mysql·性能优化
God__is__a__girl11 小时前
Oracle驱动版本引发ORA-01461批量插入异常排查与解决
数据库·oracle
少年攻城狮11 小时前
Oracle系列---【两个环境,表结构一致,数据量一致,索引也一致,为什么同样的sql执行时间却不一致?】
数据库·sql·oracle