无法与远程Heroku数据库建立psql会话

时间:2019-06-22 15:51:41

标签: postgresql heroku heroku-postgres heroku-cli

我有一个远程heroku数据库(“爱好”层),并且想建立一个远程psql连接,但是当我键入以下内容时:

heroku pg:psql

我收到以下错误:

psql: could not connect to server: Operation timed out
    Is the server running on host "ec2-54-163-230-199.compute-1.amazonaws.com" (54.163.230.199) and accepting
    TCP/IP connections on port 5432?

我已经这样编辑了postgresql.conf

listen_addresses = '*'

并添加以下行:

host all all 0.0.0.0/0 md5

到pg_hba.conf,因为我认为问题可能是我的postgres配置仅接受到本地主机的连接,但是重新启动Postgres后,我仍然遇到相同的错误。

任何人都对可能出什么问题有任何建议?如果我的防火墙被阻止了,那么有人会对如何更改它有任何建议吗?预先感谢。

1 个答案:

答案 0 :(得分:1)

必须有网络限制或防火墙设置,因为它可以在不更改conf文件的情况下起作用。