`
jickcai
  • 浏览: 248395 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Grails 配置 mysql

阅读更多

1.拷贝mysql-connector-java-5.1.10-bin.jar到Libraries目录下.

2.修改configuration/DataSource.groovy文件为:

dataSource {

pooled = true

driverClassName = "com.mysql.jdbc.Driver"

username = "root"

password = "root"

}

hibernate {

    cache.use_second_level_cache=true

    cache.use_query_cache=true

    cache.provider_class='net.sf.ehcache.hibernate.EhCacheProvider'

}

// environment specific settings

environments {

development {

dataSource {

dbCreate = "create-drop" // one of 'create', 'create-drop','update'

url = "jdbc:mysql://localhost/cms"

}

}

test {

dataSource {

dbCreate = "update"

url = "jdbc:mysql://localhost/cms"

}

}

production {

dataSource {

dbCreate = "update"

url = "jdbc:mysql://localhost/cms;shutdown=true"

}

}

}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics