springboot一键application.yml配置文件
server : port : 8080 ##项目名字配置 #servlet : # context-path : /demo tomcat : uri-encoding : UTF-8 #xx 报错修改的地方 max-connections: 200000 max-http-form-post-size: 9000000 threads: max: 128 min-spare: 5 spring : # 环境 dev|test|prod profiles : active : dev #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml #include: ftpHX,ftpCloud servlet: multipart: #设置总上传的数据大小 max-request-size: 100MB #单个文件大小 maxFileSize : 30MB #xx 报错修改的地方 max-connections: 200000 max-http-post-size: 9000000 #热部署模块 devtools: restart: #热部署开关 enabled: true #指定热部署的目录 additional-paths: src/main/java #指定目录不更新 exclude: test/** mvc: #静态文件 static-path-pattern : /static/** pathmatch: matching-strategy: ant_path_matcher #模板引擎 thymeleaf: model: HTML5 prefix: classpath:/templates/ suffix: .html #指定编码 encoding: utf-8 #禁用缓存 默认false cache: false jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss redis: ssl: false database: 0 host: 127.0.0.1 port: 6379 password: timeout: 1000 lettuce: pool: max-active: 200 max-wait: -1 max-idle: 10 min-idle: 0 #mybatis: # #配置mapper的扫描,找到所有的mapper.xml映射文件 # mapperLocations : classpath*:mybatis/*/*.xml # #mybatis提供三种sql执行器,分别是SIMPLE、REUSE、BATCH。 # executor-type : reuse # #搜索指定包别名 # typeAliasesPackage : com.*.model # #该配置项就是指将带有下划线的表字段映射为驼峰格式的实体类属性。 # configuration : # map-underscore-to-camel-case : true # 控制台输出sql、下划线转驼峰 mybatis-plus: mapper-locations: classpath:/mybatis-plus/*.xml typeAliasesPackage: com.fc.pilotSchool.model # 控制台输出sql、下划线转驼峰 configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl map-underscore-to-camel-case: true #pagehelper分页插件 pagehelper: helperDialect: mysql reasonable: true supportMethodsArguments: true params: count=countSql oss: enable: true info: true path-style-access: false #使用云OSS 需要关闭 endpoint: http://127.0.0.1:9000 #对应上图 ③ 处配置 access-key: minioadmin # 上文创建的AK secret-key: minioadmin # 上文创建的SK bucket-name: v2-cloud # 上文创建的桶名称
application-dev.yml文件
#dev环境 mysql7.0 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver #druid连接池配置 druid: #主库数据源 master: url: jdbc:mysql://xxx.xxx.xxx.xxx:3306/xxxx?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT username: xxxxx password: xxxxx #备数据源 #关闭 slave: enabled: false url: jdbc:mysql://localhost:3306/xxxx?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false username: xxxx password: xxxx #配置初始化连接数大小 initial-size: 10 # 最大连接数 maxActive: 50 #最小连接数 minIdle: 10 #获取连接等待超时时间 maxWait: 5000 poolPreparedStatements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。 maxPoolPreparedStatementPerConnection-size: 20 validationQuery: SELECT 1 FROM DUAL validationQueryTimeout: 20000 testOnBorrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 testOnReturn: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 testWhileIdle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 timeBetweenEvictionRunsMillis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 minEvictableIdleTimeMillis: 300000 #一个连接在池中最小生存的时间,单位是毫秒 maxEvictableIdleTimeMillis: 900000 # 配置一个连接在池中最大生存的时间,单位是毫秒 #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定) webStatFilter: enabled: true statViewServlet: enabled: true urlPattern: /druid/* #可以增加访问账号密码【去掉注释就可以】 #login-username: admin #login-password: admin filter: stat: enabled: true # 慢SQL记录 log-slow-sql: true slow-sql-millis: 1000 merge-sql: true wall: config: multi-statement-allow: true #mysql 8.0 #spring: # datasource: # type: com.alibaba.druid.pool.DruidDataSource # driverClassName: com.mysql.cj.jdbc.Driver # #druid连接池配置 # druid: # # 主库数据源 # master: # url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false # username: root # password: root # #树熊数据源 # slave: # enabled : false # url: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false # username: root # password: root # #配置初始化连接数大小 # initial-size: 10 # # 最大连接数 # max-active: 50 # #最小连接数 # min-idle: 10 # #获取连接等待超时时间 # max-wait: 5000 # pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。 # max-pool-prepared-statement-per-connection-size: 20 # validation-query: SELECT 1 FROM DUAL # validation-query-timeout: 20000 # test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 # test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 # test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 # time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 # min-evictable-idle-time-millis: 300000 #一个连接在池中最小生存的时间,单位是毫秒 # #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定) # stat-view-servlet: # enabled: true # url-pattern: /druid/* # #可以增加访问账号密码【去掉注释就可以】 # #login-username: admin # #login-password: admin # filter: # stat: # log-slow-sql: true # slow-sql-millis: 1000 # merge-sql: true # wall: # config: # multi-statement-allow: true
__EOF__
本文作者:Reisen7
本文链接:https://www.cnblogs.com/reisen7/p/18547114.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!
本文链接:https://www.cnblogs.com/reisen7/p/18547114.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!