SpringBoot中的application.yml常用配置
2020-03-01 03:47
274 查看
服务器配置
server.port=8081
server.context-path=/springboot
dev和prod版本切换
spring.profiles.active:dev
数据库配置
spring.datasource.driver-class-name:com.mysql.jdbc.Driver
说明:若出现驱动错误解决方案如下:
driver-class-name:com.mysql.cj.jdbc.Driver
spring.datasource.url:jdbc:mysql://127.0.0.1:3306/dbgirl
说明:若出现时区或编码问题解决方案如下:
url: jdbc:mysql://127.0.0.1:3306/dbgirl?serverTimezone=GMT%2B8&characterEncoding=utf8&characterSetResults=utf8
spring.datasource.username:root
spring.datasource.password:123456
spring.jpa.hibernate.ddl-auto:update
说明:常用update----每次运行程序,没有表格会新建表格,表内有数据不会清空,只会更新
spring.jpa.show-sql:true
说明:格式化输出SQL语句方便调试:
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- SpringBoot常用配置 application.yml /application.properties常用配置介绍
- SpringBoot常用配置 application.yml /application.properties常用配置介绍
- spring-boot配置(一):@Configuration,@ConfigurationProperties和application.yml
- springboot项目logback.xml或者logback-spring.xml中读取不到application.yml或application.properties配置文件中的配置解决办法
- spring boot 读取配置文件(application.yml)中的属性值
- spring boot 配置文件(application.yml)中的属性值配置
- spring boot 读取配置文件(application.yml)中的属性值
- Spring Boot 中的.yml和.properties的常用配置
- SpringBoot application.yml logback.xml,多环境配置,支持 java -jar --spring.profiles.active(转)
- Spring boot + MySQl + druid + JPA + AOP pom文件 以及 application.yml 的配置
- Springboot为什么加载不上application.yml的配置文件
- spring boot 读取配置文件(application.yml)中的属性值
- Spring Boot系列 - 4. 读取配置文件(application.yml)中的属性值
- Spring boot 学习笔记(1)——hello world创建,属性application.properties、 yml配置
- SpringCloud入门之常用的配置文件 application.yml和 bootstrap.yml区别
- Spring Boot 菜鸟教程 application.properties 常用配置
- SpringBoot配置文件application.yml (application.properties)
- SpringBoot application.yml logback.xml,多环境配置,支持 java -jar --spring.profiles.active
- springboot如何读取配置文件(application.yml)中的属性值
- spring boot 读取配置文件(application.yml)中的属性值