Grails MySQL连接

时间:2015-08-21 20:09:01

标签: mysql grails ggts

当我尝试在GGTS上连接到MySQL时,我收到以下错误:

  

java.lang.IllegalArgumentException:错误的工件坐标mysql-connector-java-5.1.36-bin,预期格式为:[:[:]]:

我在VM上运行UGntu上的GGTS。

我已经读过Windows出现问题。这可能与Ubuntu相似吗?

1 个答案:

答案 0 :(得分:1)

您尚未在grails-app/conf/application.groovy中正确配置grails数据源。

它应该是这样的:

dataSource {
    dbCreate = "update"
    url = "jdbc:mysql://localhost:3306/my_database"
    driverClassName = "com.mysql.jdbc.Driver"
    dialect = org.hibernate.dialect.MySQL5InnoDBDialect
    username = "username"
    password = "password"
}

请记住,如果您有当前执行环境的特定配置(例如生产),则必须编辑相关配置:

environments {
    production {
        dataSource {
            url = "jdbc:mysql://liveip.com/liveDb"
            // other environment-specific settings here
        }
    }
}

有关完整参考,请参阅grails data source documentation