无法连接到Heroku上托管的pg数据库 [英] can not connect to the pg database hosting on Heroku

查看:168
本文介绍了无法连接到Heroku上托管的pg数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试连接到PG数据库时,出现以下错误:


$ heroku pg:psql --app rf1

psql:无法连接到服务器:操作超时
服务器在主机ec2-184-73-161-119.compute-1.amazonaws.com上运行并接受
TCP / IP连接在端口5432上?


我该如何修复它?
Ps:我在OS X环境中运行并安装了本地pg。



更新:

  heroku pg:info --app rf1 
=== SHARED_DATABASE(DATABASE_URL)
数据大小:312k


解决方案

您需要运行Heroku的生产数据库或其新开发9.1数据库中的一个,以便能够连接到来自外部的数据库;

https:// devcenter.heroku.com/articles/heroku-postgresql
https://postgres.heroku.com/blog/past/2012/4/26/heroku_postgres_development_plan/


When try connecting to the PG database I got following error:

$ heroku pg:psql --app rf1
psql: could not connect to server: Operation timed out Is the server running on host "ec2-184-73-161-119.compute-1.amazonaws.com" and accepting TCP/IP connections on port 5432?

How could I fix it? P.s: I am running on a OS X environment and have local pg installed.

Update:

heroku pg:info --app rf1
=== SHARED_DATABASE (DATABASE_URL)
Data Size: 312k

解决方案

You need to be running one of Heroku's production databases or their new development 9.1 database to be able to connect to the DB from outside;

https://devcenter.heroku.com/articles/heroku-postgresql https://postgres.heroku.com/blog/past/2012/4/26/heroku_postgres_development_plan/

这篇关于无法连接到Heroku上托管的pg数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆