“Failed to configure a DataSource: 'url' attribute is not specified and no embedd”
意思为配置数据源失败:未指定且未嵌入'url'属性
只需要在application.properties中写入代码
#应用名称
spring.application.name=springboot-demo
#访问端口号
server.port=8080
#编码格式
server.tomcat.uri-encoding=utf-8
#数据库相关配置
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&useAffectedRows=true
spring.datasource.username=root
spring.datasource.password=111111
spring.datasource.max-idle=10
spring.datasource.max-wait=10000
spring.datasource.min-idle=5
spring.datasource.initial-size=5
#session生命周期
server.servlet.session.timeout=30m
注意:数据库名称和密码根据自己的数据库设置进行修改