application.yaml
数据库配置(Mysql)
spring:
datasource:
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC&useSSL=true
username: root
password: 123456
项目基础
server:
servlet:
context-path: /test
port: 80
Redis
spring:
redis:
database: 0
# Redis服务器地址 写你的ip
host: 127.0.0.1
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码(默认为空)
password:
# 连接池最大连接数(使用负值表示没有限制 类似于mysql的连接池
jedis:
pool:
max-active: 200
# 连接池最大阻塞等待时间(使用负值表示没有限制) 表示连接池的链接拿完了 现在去申请需要等待的时间
max-wait: -1
# 连接池中的最大空闲连接
max-idle: 10
# 连接池中的最小空闲连接
min-idle: 0
# 连接超时时间(毫秒) 去链接redis服务端
timeout: 6000
mybatis-plus别名设置
mybatis-plus:
type-aliases-package: com.hear.entity
文件上传
spring:
servlet:
multipart:
# 开启文件上传功能
enabled: true
max-file-size: 100MB
max-request-size: 100MB
本文详细介绍了如何在Spring Boot项目中配置Mysql数据库连接,包括URL、用户名和密码,并探讨了Redis缓存配置,Mybatis-Plus别名设置以及文件上传配置。
1909

被折叠的 条评论
为什么被折叠?



