开发yml常用配置
1. redis配置
redis:
host: 172.168.20.221
database: 0
port: 6379
timeout: 1000
2. mybatis配置
#mybatis-plus表名配置 数据库表的自增策略也可以在这里配置
# 如果使用xml配置mapper接口的实现,那就要配置mapper的位置
mybatis-plus:
global-config:
db-config:
table-prefix: t_
id-type: auto
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#mybatis配置
mybatis:
#配置全限定类名
type-aliases-package: com.sam.springcloud.pojo
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath:mybatis/mapper/*.xml
3. 数据源的配置
#Druid的的配置方式:
#spring:
# datasource:
# druid:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/spring_boot_study?serverTimezone=UTC
# username: root
# password: root
#使用原生的数据库链接配置
spring:
mvc:
hiddenmethod:
filter:
enabled: true
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/jxgl?serverTimezone=UTC
username: root
password: root
浙公网安备 33010602011771号