初步搭建springboot应用,报错:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedd
翻译就是:无法配置DataSource:未指定’url’属性,也无法配置嵌入数据源。
原因是缺少相关配置地址值啊,数据库驱动啊,用户名啊,密码啊,
那么我将把SpringBoot的一些最基本的配置信息给大家站出来:
相关配置如下
#访问根路径
#应用名称
spring.application.name=springboot-demo
#访问端口号
server.port=8080
#编码格式
server.tomcat.uri-encoding=utf-8
#数据库相关配置
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/mysql
spring.datasource.username=root
spring.datasource.password=123
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
项目就起来啦