Skip to main content
 首页 » 编程设计

SpringBoot数据源配置YAML格式

2022年07月18日30luoye11
spring: 
  datasource: 
    url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=Hongkong&allowPublicKeyRetrieval=true 
    username: root 
    password: 123456 
    driver-class-name: com.mysql.cj.jdbc.Driver 
    hikari: 
      connection-test-query: SELECT 1 FROM DUAL 
      connection-timeout: 30000 
      maximum-pool-size: 20 
      max-lifetime: 1800000 
      minimum-idle: 5

本文参考链接:https://www.cnblogs.com/maohuidong/p/12145782.html