首页 > 解决方案 > 如何从 Heroku 外部连接到 Heroku Postgres 数据库

问题描述

我正在尝试使用外部客户端连接到与我的 Heroku 应用程序关联的 Postgres 数据库(爱好开发)。

我已经阅读了文档(https://devcenter.heroku.com/articles/connecting-to-heroku-postgres-databases-from-outside-of-heroku),似乎有可能,但是当我收到以下错误时试图从我的客户访问数据库:

psql: could not connect to server: Connection refused
        Is the server running on host "[redacted].amazonaws.com" ([redacted ip address]) and accepting TCP/IP connections on port 5432?

从我缺乏经验的角度来看,似乎 postgres 实例拒绝了某个 IP 范围之外的连接。我在 Heroku 仪表板中没有看到与此相关的设置(例如绑定地址或类似的东西)。

标签: herokuheroku-postgres

解决方案


推荐阅读