【发布时间】:2017-02-06 17:55:49
【问题描述】:
首先,我在 Heroku 中创建了 PostgreSQL 数据库。我通过 pgAdmin 远程访问手动创建了我的 DB/schema/tables。我知道我成功了,因为它更新了我的行数限制。
现在,我正在部署一个 Spring Boot 应用程序。
在我的application.properties 文件中没有找到数据库道具/凭据,因为我应该在 Heroku Config Vars 中执行此操作。例如,我的数据库用户名是 janxgspmlpjgbn
项目构建成功,但是,在日志中我看到它有这个异常。
2016-09-28 16:12:31.184 [ERROR] org.apache.juli.logging.DirectJDKLog.log:181 - Unable to create initial connections of pool.
2016-09-28T16:12:31.185772+00:00 app[web.1]: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "u24453"
问题
为什么在我的 Config Var 中输入用户 janxgspmlpjgbn 时,用户 u24453 会失败(顺便说一下,每次我重新部署此用户都会更改)?
编辑
【问题讨论】:
-
您提到您“键入”了您的配置变量。您没有使用 Heroku 为您提供的
DATABASE_URL? -
嗨,我不确定它使用的是我“键入”的 DATABASE_URL 还是 SPRING_DATASOURCE_ 变量。
标签: java spring postgresql heroku spring-boot