无法通过heroku连接到postgres数据库

时间:2013-05-02 00:46:24

标签: database postgresql heroku

我有一个我通过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?

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

1 个答案:

答案 0 :(得分:2)

要从命令行访问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"

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

相关问题