db.yml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # mysql 配置模板
  2. # 优先从环境变量里取值
  3. shoulder:
  4. mysql:
  5. ip: 127.0.0.1
  6. port: 3306
  7. driverClassName: com.mysql.cj.jdbc.Driver
  8. database: shoulder_platform
  9. username: root
  10. password: root
  11. database: # 数据库配置请看 DatabaseProperties 类上的注释
  12. bizDatabase: shoulder_base
  13. multiTenantType: SCHEMA
  14. isNotWrite: false
  15. isBlockAttack: false # 是否启用 攻击 SQL 阻断解析器
  16. worker-id: 0
  17. data-center-id: 0
  18. # mysql 通用配置
  19. spring:
  20. datasource:
  21. druid:
  22. username: ${shoulder.mysql.username}
  23. password: ${shoulder.mysql.password}
  24. driver-class-name: ${shoulder.mysql.driverClassName}
  25. url: jdbc:mysql://${shoulder.mysql.ip}:${shoulder.mysql.port}/${shoulder.mysql.database}?serverTimezone=CTT&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
  26. db-type: mysql
  27. initialSize: 10
  28. minIdle: 10
  29. maxActive: 500
  30. max-wait: 60000
  31. pool-prepared-statements: true
  32. max-pool-prepared-statement-per-connection-size: 20
  33. validation-query: SELECT 'x'
  34. test-on-borrow: false
  35. test-on-return: false
  36. test-while-idle: true
  37. time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  38. min-evictable-idle-time-millis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
  39. filters: stat,wall
  40. filter:
  41. wall:
  42. enabled: true
  43. config:
  44. commentAllow: true
  45. multiStatementAllow: true
  46. noneBaseStatementAllow: true
  47. web-stat-filter: # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter
  48. enabled: true
  49. url-pattern: /*
  50. exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
  51. session-stat-max-count: 1000
  52. profile-enable: true
  53. session-stat-enable: false
  54. stat-view-servlet: #展示Druid的统计信息,StatViewServlet的用途包括:1.提供监控信息展示的html页面2.提供监控信息的JSON API
  55. enabled: true
  56. url-pattern: /druid/* #根据配置中的url-pattern来访问内置监控页面,如果是上面的配置,内置监控页面的首页是/druid/index.html例如:http://127.0.0.1:9000/druid/index.html
  57. reset-enable: true #允许清空统计数据
  58. login-username: shoulder
  59. login-password: shoulder
  60. jpa:
  61. database: MYSQL
  62. hibernate:
  63. #ddl-auto: update
  64. properties:
  65. hibernate:
  66. dialect: org.hibernate.dialect.MySQL8Dialect
  67. show-sql: true
  68. mybatis-plus:
  69. mapper-locations:
  70. - classpath*:mapper_**/**/*Mapper.xml
  71. #实体扫描,多个package用逗号或者分号分隔 todo 修改这里
  72. #typeAliasesPackage:
  73. #typeEnumsPackage:
  74. global-config:
  75. db-config:
  76. id-type: INPUT
  77. insert-strategy: NOT_NULL
  78. update-strategy: NOT_NULL
  79. select-strategy: NOT_EMPTY
  80. configuration:
  81. # 下划线(列名)自动转驼峰(java对象属性名)
  82. map-underscore-to-camel-case: true
  83. cache-enabled: false
  84. #配置JdbcTypeForNull, oracle数据库必须配置
  85. jdbc-type-for-null: 'null'