首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法从数据源获取JDBC连接

无法从数据源获取JDBC连接
EN

Stack Overflow用户
提问于 2013-04-20 15:05:46
回答 1查看 4.3K关注 0票数 1

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

代码语言:javascript
复制
    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

脚本文件在这里,第#行。错误显示为357,但我不知道为什么它会显示错误。是不是mysql服务器的配置不正确,请在这里帮助我: script:

代码语言:javascript
复制
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()
}
EN

回答 1

Stack Overflow用户

发布于 2013-04-25 05:43:34

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16117699

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档