springboot的配置文件有两种格式分别是properties和yml/yaml
创建配置文件




在创建springboot项目时候,会默认生成application.properties这种格式
书写风格
端口
application.propertis
server.port=8080
application.yml
server: port: 8080
连接数据库
application.propertis
spring.datasource.url=jdbc:mysql://localhost:3306/xxxx?setUnicode=true&characterEncoding=utf8 spring.datasource.name= spring.datasource.password=
application.yml
spring:
datasource:
name:
password:
url: jdbc:mysql://localhost:3306/xxx?setUnicode=true&characterEncoding=ucong
从连接数据库配置上来看,用application.yml格式来书写,代码会简洁的多


















![[论文必备]最强科研绘图分析工具Origin(1)——安装教程](https://img-blog.csdnimg.cn/70d88b7c6d8647fcb3cdf37f074d1b4d.gif)
