Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
//未能配置数据源:未指定“url”属性,无法配置嵌入的数据源。
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.
//如果你想加载嵌入式数据源(H2, HSQL or Derby),请把它放在路径中
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
//如果从指定问价加载数据库配置,你可能需要激活它(当前没有激活的配置文件)
Disconnected from the target VM, address: '127.0.0.1:61294', transport: 'socket'
Process finished with exit code 0
提示的很清楚!!!!
如果数据源就在application.yml中配置,选择第一种方法:把数据源配置到指定路径,指定路径是什么呢?
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource # 数据源操作类型
driver-class-name: com.mysql.jdbc.Driver # mysql驱动包
url: jdbc:mysql://127.0.0.1:3306/clouddb01
username: root
password: root
所以这个时候需要检查一下application.yml配置文件是否配置正确
如果数据源就不在application.yml中配置,选择第二种方法
1.springboot默认加载datasource,如果找不到上述配置就会报错
2.具体要看数据源配置放在哪里,可以放在nacos上,或者其他加密服务里面
具体情况具体分析吧。。。。


4万+

被折叠的 条评论
为什么被折叠?



