前言:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedd这个错误想必大家已经非常非常熟悉了,关于数据库配置的问题,但是这种错误还有一种坑,随我来看
1.对于这个错误,一般是没有配置数据源导致
spring:
datasource:
# 当前数据源操作类型
type: com.alibaba.druid.pool.DruidDataSource
# mysql驱动类
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/db_info?useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: root
2.在pom文件中,自动生成了打包模式为pom模式,删除即可
问题得到完美解决!