application.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. server:
  2. port: 8080
  3. spring:
  4. datasource:
  5. type: com.alibaba.druid.pool.DruidDataSource
  6. driver-class-name: com.mysql.cj.jdbc.Driver
  7. url: jdbc:mysql://www.tianyunperfect.cn:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
  8. username: test_cps
  9. password: xKysDECnJLXkMYdJ
  10. #下面为连接池补充设置
  11. druid:
  12. initial-size: 5 # 初始化
  13. max-active: 5 # 最大
  14. min-idle: 5 # 最小
  15. max-wait: 6000 # 超时时间
  16. time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
  17. min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
  18. # 检测链接是否有效的query
  19. validation-query: SELECT 1 FROM DUAL
  20. test-while-idle: true # 检测到链接空闲时,验证是否有效
  21. test-on-borrow: false # 申请链接时,不检测
  22. test-on-return: false # 返回链接时,不检测
  23. pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
  24. # 如果上面开启了游标,这里要设置一下大小,例如 50
  25. max-pool-prepared-statement-per-connection-size: -1
  26. # 统计、监控配置
  27. filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
  28. # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
  29. connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
  30. use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
  31. stat-view-servlet:
  32. enabled: true
  33. login-username: tianyun
  34. login-password: tianyunperfect
  35. allow: # 默认运行所有
  36. deny: # 默认即可
  37. reset-enable: true
  38. mybatis:
  39. type-aliases-package: com.book.server.entity
  40. mapper-locations: classpath:mapper/*Mapper.xml
  41. # 设置debug模式下打印mysql
  42. logging:
  43. level:
  44. com:
  45. book:
  46. server:
  47. mapper: debug