sql >> Database teknologi >  >> RDS >> Mysql

Opsætning af Grails 3.1.0 med MySQL

Her er min

build.gradle:

dependencies {
    runtime 'mysql:mysql-connector-java:5.1.20'

}

Nu application.yml:

dataSources:
    dataSource:
        pooled: true
        jmxExport: true
        driverClassName: com.mysql.jdbc.Driver
        dialect: org.hibernate.dialect.MySQL5InnoDBDialect
        username: username
        password: opendoor_policy
    nextdbsource:
        pooled: true
        jmxExport: true
        driverClassName: com.mysql.jdbc.Driver
        dialect: org.hibernate.dialect.MySQL5InnoDBDialect
        username: username
        password: opendoor_policy
        url: jdbc:mysql://localhost:3306/nextdbsource?autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8
        dbCreate: update

environments:
    development:
        dataSources:
            dataSource:
                dbCreate: update
                url: jdbc:mysql://localhost:3306/db1?autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8
    test:
        dataSources:
            dataSource:
                dbCreate: update
                url: jdbc:mysql://localhost:3306/db1?autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8
    production:
        dataSources:
            dataSource:
                dbCreate: update
                url: jdbc:mysql://localhost:3306/db1?autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8
                properties:
                    jmxEnabled: true
                    initialSize: 5
                    maxActive: 50
                    minIdle: 5
                    maxIdle: 25
                    maxWait: 10000
                    maxAge: 600000
                    timeBetweenEvictionRunsMillis: 5000
                    minEvictableIdleTimeMillis: 60000
                    validationQuery: SELECT 1
                    validationQueryTimeout: 3
                    validationInterval: 15000
                    testOnBorrow: true
                    testWhileIdle: true
                    testOnReturn: false
                    jdbcInterceptors: ConnectionState
                    defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED

---

det virker for mig, og det opsætter 2 datakilder




  1. Tom erklæring i T-SQL

  2. Databasedesign:EAV-muligheder?

  3. Skift PostgreSQL-kolonner, der bruges i visninger

  4. Forespørgselsoptimering i PostgreSQL. FORKLAR Grundlæggende – Del 2