SpringBoot application.properties 配置文件

#设置 Spring Boot 应用的名称为 ???,这个名称通常用于服务注册与发现
spring.application.name=???


#服务器端口,指定 Spring Boot 内嵌服务器(如 Tomcat)运行的端口号为 8080。访问 Web 应用时,可以通过 http://localhost:8080 访问
server.port=8080


#数据库驱动,指定数据库的 JDBC 驱动类,这里使用 MySQL 的官方驱com.mysql.cj.jdbc.Driver(cj 代表 Connector/J)。
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver


#数据源名称,Spring Boot 默认不会使用 这个配置(可以忽略)
spring.datasource.name=defaultDataSource


#数据库连接地址,连接本地 MySQL 数据库 (localhost:3306);数据库名称写入括号内(),serverTimezone=UTC 指定数据库的时区为 UTC,避免时区问题
spring.datasource.url=jdbc:mysql://localhost:3306/()?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
#较全面链接
#jdbc:mysql://localhost:3306/( )?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&allowPublicKeyRetrieval=true


#数据库用户名&密码,密码为0开头需要加单引号,例如 '0123456'
spring.datasource.username=root
spring.datasource.password=123456


#自动更新数据库表结构
spring.jpa.hibernate.ddl-auto=update


#显示sql语句
spring.jpa.show-sql=true


#格式化显示Sql语句
spring.jpa.properties.hibernate.format_sql=true


#数据库语言配置,用于指定底层数据库方言的配置属性,主要用于适配不同数据库的 SQL 语法和特性差异(一般不需要)
#spring.jpa.database-platform=org.hibernate.dialect.H2Dialect


# 配置mybatis实体和xml映射,路径为 resources 文件下的 mapper 文件下的所有 xml文件,classpath: 表示 resources 的目录
mybatis.mapper-locations=classpath:mapper/*.xml


#数据库配置日志在控制台打印
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl


#数据库 带下划线字段名 自动转为 驼峰命名,user_id -> userId
mybatis.configuration.map-underscore-to-camel-case=true

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值