服务器配置
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