【问题标题】:Unable to connect to postgres database through heroku无法通过heroku连接到postgres数据库
【发布时间】:2013-05-02 09:07:25
【问题描述】:

我有一个通过 heroku 创建的 postgres 数据库。我正在尝试使用以下命令通过 psql 访问它:

cse-190-fortune matanvardi$ psql "dbname=dccemfsa6camml host=ec2-54-235-152-226.compute-1.amazonaws.com \
user=tfmfbqxqjznsbl password=********* port=5432 sslmode=require"

我得到这个错误:

psql: could not connect to server: Operation timed out
    Is the server running on host "ec2-54-235-152-226.compute-1.amazonaws.com" and accepting
    TCP/IP connections on port 5432?

我已经克隆了存储库并已登录,但我根本无法弄清楚这里出了什么问题。任何帮助将不胜感激。

【问题讨论】:

  • 是否有任何出站过滤防火墙?

标签: database postgresql heroku


【解决方案1】:

要从命令行访问您的 Heroku 数据库,请使用以下命令:

heroku pg:psql


编辑:

我从我的机器上运行了你的命令。如果当然我没有你的密码,但我得到了:

$  psql "dbname=dccemfsa6camml host=ec2-54-235-152-226.compute-1.amazonaws.com user=tfmfbqxqjznsbl port=5432 sslmode=require"
Password:
psql: FATAL:  password authentication failed for user "tfmfbqxqjznsbl"

这意味着我能够连接,这比你得到的更远。一定是您的网络设置有问题。

【讨论】:

  • 这给了我与上面提到的相同的结果
  • @MatanVardi 那么你的网络有问题,可能是防火墙过于严格或某处路由器配置错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-08-18
  • 2013-04-21
  • 2021-07-10
  • 2018-07-20
  • 2014-10-08
  • 2017-02-24
  • 2015-08-14
相关资源
最近更新 更多