Spring boot 整合mybatis 使用阿里巴巴druid配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ypp91zr/article/details/82713400
spring: 
    datasource:
        type: com.alibaba.druid.pool.DruidDataSource
        driverClassName: com.mysql.jdbc.Driver
        driver-class-name: com.mysql.jdbc.Driver
        platform: mysql
        url: jdbc:mysql://211.149.199.68:3306/mypinyu?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
        username: root
        password: Goodlan@123
        initialSize: 5
        minIdle: 5
        maxActive: 20
        maxWait: 60000
        timeBetweenEvictionRunsMillis: 60000
        minEvictableIdleTimeMillis: 300000
        validationQuery: SELECT1FROMDUAL
        testWhileIdle: true
        testOnBorrow: false
        testOnReturn: false
        filters: stat,wall,log4j
        logSlowSql: true
    
    
mybatis: 
  typeAliasesPackage: com.pinyu.system.entity 
  mapper-locations: classpath:mapper/*.xml

注意key:后面必须要有一个空格,这好像是yml文件的格式

猜你喜欢

转载自blog.csdn.net/ypp91zr/article/details/82713400