zoukankan      html  css  js  c++  java
  • Grails连接mysql数据库

      1.Grails在连接mysql数据库是如果出现type=InnDe什么什么的错时,最好在将dataSource里面的方言(dialect)的值修改成

    1 dataSource {
    2     pooled = true
    3     driverClassName = "com.mysql.jdbc.Driver"
    4     username = "root"
    5     password = "root"
    6     dialect = org.hibernate.dialect.MySQL5InnoDBDialect  
    7 }

      这样就可以顺利连接数据库

    Grails - DataSource.groovy

     1 dataSource {
     2     pooled = true
     3     driverClassName = "com.mysql.jdbc.Driver"
     4     username = "root"
     5     password = "root"
     6     dialect = org.hibernate.dialect.MySQL5InnoDBDialect
     7 }
     8 hibernate {
     9     cache.use_second_level_cache = true
    10     cache.use_query_cache = false
    11     cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
    12 }
    13 // environment specific settings
    14 environments {
    15     development {
    16         dataSource {
    17             dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
    18             url = "jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8"
    19         }
    20     }
    21 }
    如果有使用请标明来源:http://www.cnblogs.com/duwenlei/
  • 相关阅读:
    github代码上传下载慢问题
    React Native环境搭建
    分布式模式之Broker模式
    如何构建技术体系
    https nginx配置
    自我管理--拖延 vs 心理
    idea+maven本地仓库更新问题
    后台服务集群日志管理
    技术男励志圣经
    线段树合并
  • 原文地址:https://www.cnblogs.com/duwenlei/p/3668253.html
Copyright © 2011-2022 走看看