springboot中自己常用的application.properties的配置和application.yml的配置

springboot中application.properties相关的基础配置
#MySQL端口配置
#server.port=8080
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/blog1(数据库名称)?charset=utf8mb4&useSSL=false&useJDBCCompliantTimezoneShift=true&serverTimezone=UTC
spring.datasource.username=(数据库账号)
spring.datasource.password=(数据库密码)

上下文数据配置

server.servlet.context-path=/demo(上下文所需要的路径名)

Hikari 数据源专用配置

spring.datasource.hikari.maximum-pool-size=20
spring.datasource.hikari.minimum-idle=5

JPA 相关配置

spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql=true
spring.jpa.open-in-view=false
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
#spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.hbm2ddl.auto=update
spring.freemarker.check-template-location=false
logging.level.root=info
logging.level.com.lrm=debug
logging.file=log/blog-dev.log
spring.thymeleaf.mode=HTML
spring.thymeleaf.suffix=.html
spring.thymeleaf.prefix=classpath:/templates/
#github配置
github.client.id=24233a5a0ff6abf981da
github.client.secret=290f422bcbc4081ae36779e53ea4be08880ada5a
github.redirect.uri=http://localhost:8080/callback
#mybatis的配置
mybatis.mapper-locations=classpath:mapping/*.xml

#ymlMySQL数据库基础配置
#注意,:后边要有空格
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: 账号
password: 冒号
url: jdbc:mysql://localhost:3306/数据库名?charset=utf8mb4&useSSL=false&useJDBCCompliantTimezoneShift=true&serverTimezone=UTC
jpa:
show-sql: true

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值