启动报这个错误是什么问题

来源:2-2 创建 SpringBoot 项目

HaganWu

2023-12-01

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

写回答

3回答

Howiedu

2024-02-20

这个我觉得还是换成和老师一样的版本吧,我用JDK17也有这个问题,换成了14+java11,springboot版本也调到2.几就可以正常跑了。。

0
0

慕码人8147685

2023-12-01

同学我也是这个问题,我在EmosWxApiApplication.java在这里注解后面加了括号的内容

@SpringBootApplication(exclude =  {DataSourceAutoConfiguration.class })

这要就不报错了但是也没从根本解决问题

你解决了踢我一下哈哈

0
2
阿阳2017
回复
HaganWu
回复 HaganWu:把url,username,password,driver-class-name移动到datasource下面就可以了。这种方式亲测可行。厉害了!
2025-03-08
共2条回复

神思者

2023-12-01

估计是yml文件中的MYSQL配置的不对

0
3
神思者
回复
HaganWu
你的SpringBoot版本应该跟我的不一样,不同版本Druid连接池配置不同。
2023-12-02
共3条回复

SpringBoot 在线协同办公小程序开发 全栈式项目实战

未来趋势型业务 + 前后端综合技术栈 + 惊艳的细节打磨

1798 学习 · 1915 问题

查看课程