1

我试图在 gradle 中运行以下命令,它给了我以下错误:

    c:\gsoc\mifosx\mifosng-provider>gradle migrateTenantListDB -PdbName=mifosplatfor
m-tenants
Listening for transport dt_socket at address: 8005
:migrateTenantListDB FAILED

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\gsoc\mifosx\mifosng-provider\build.gradle' line: 357

* What went wrong:
Execution failed for task ':flywayMigrate'.
> Unable to obtain Jdbc connection from DataSource

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 13.843 secs

脚本文件在这里,行号。of error 显示为 357,但我不知道为什么它显示错误。是否与mysql服务器中的配置不正确有关,请在此处帮助我:脚本:

task migrateTenantListDB<<{
    description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"

    def filePath = "filesystem:$projectDir" + System.properties['file.separator'] + '..' + System.properties['file.separator'] + 'mifosng-db' + System.properties['file.separator'] + 'migrations/list_db'
    def tenantsDbName = 'mifosplatform-tenants';
    if (rootProject.hasProperty("dbName")) {
        tenantsDbName = rootProject.getProperty("dbName")
    }

    flyway.url= "jdbc:mysql://localhost:3306/$tenantsDbName"
    flyway.locations= [filePath]

    flywayMigrate.execute()
}
4

1 回答 1

0

该项目的 gradle 脚本已将 mysql 密码硬编码为 mysql。在尝试此命令之前,您需要将 localhost 密码设置为 mysql 并检查连接。

于 2013-04-24T21:43:34.403 回答