我有 same问题,我还指定了带引号的连接属性,jdbs:postgresQL 等
db.default.driver="org.postgresql.Driver"
db.default.url="jdbc:postgresql://my_user:my_pass@my.host:5432/postdb"
db.default.user=my_user
db.default.password="my_pass"
密码,带引号或不带引号的驱动程序,同样的错误
Configuration error
Cannot connect to database [default]
有很多这样的问题,但是在定义“postgresql”而不是“postgres”或引用没有帮助时解决了
但我可以使用 psql -h my.host -U my_user postdb 连接到数据库 (Ubuntu)
也在 documentation 中我们看到 url db.default.url=postgres://localhost:root@secret/myDatabase 其中另一个命令用于用户名、密码等,但它也不起作用
我在 build.sbt 中有 libraryDependencies += "org.postgresql"% "postgresql"% "9.2-1003-jdbc4"
有人可以提出问题所在吗?谢谢 附言我是 scala 的新手,任何帮助都会很有用
最佳答案
不确定是什么造成了差异,但以下是相同库版本 (9.2-1003-jdbc4
) 对我有用的内容:
db.default.url="postgres://username:pwd@localhost:5432/dbname"
关于postgresql - 斯卡拉玩! Postgres 连接失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27486970/