Failed to configure a DataSource問題
**1、問題:**Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
2、解決措施:
在配置文件中添加數據庫連接配置即可:
#8084表示註冊到zookeeper服務器的支付服務提供者端口號
server:
port: 8004
#服務別名----註冊zookeeper到註冊中心名稱
spring:
application:
name: cloud-payment-service #服務名
cloud:
zookeeper:
connect-string: 47.96.134.215:2181
datasource:
type: com.alibaba.druid.pool.DruidDataSource #當前數據源操作類型
driver-class-name: com.mysql.cj.jdbc.Driver #數據庫驅動包
url: jdbc:mysql://localhost:3306/cloud?useunicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
username: root
password: