【问题标题】:Configuring PostgreSQL on Play! 2.6在 Play 上配置 PostgreSQL! 2.6
【发布时间】:2017-08-16 14:04:48
【问题描述】:

我的机器上运行了一个 PostgreSQL(v9.6) 实例。该数据库称为“postgres”。我已经设法使用 localhost:5432 在 pgAdmin 3 中打开应用程序。在我的游戏中!应用程序(v2.6.2)我已按照教程here 将驱动程序和url 添加到application.conf 文件中,并将javaJdbc 依赖项添加到我的build.sbt 文件中。所以我有以下内容:

db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://localhost:5432/postgres"
db.default.username = "user"
db.default.password = "pass"

当我运行应用程序时,虽然我在控制台中收到此错误:

Cannot connect to database [default]

有人可以向我解释为什么会这样吗?如果需要,我可以提供更多信息。

【问题讨论】:

    标签: postgresql playframework configuration


    【解决方案1】:

    所以经过相当多的挖掘后,事实证明问题实际上是我错过了 postgres dependency。如果有人遇到这个问题,我建议检查你的 build.sbt 文件,如果你缺少它,添加 org.postgres 依赖项。

    play网站上的这个documentation没有说明这一步。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-20
    • 1970-01-01
    • 2018-09-17
    相关资源
    最近更新 更多