If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

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上,或者其他加密服务里面

具体情况具体分析吧。。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值