我想用pgadmin客户端管理我的Heroku数据库。到目前为止,我一直在用psql完成这项工作。 当我使用数据从heroku pg:凭据连接de DB使用pgadmin,我获得:

发生错误: 连接服务器错误:FATAL:拒绝数据库权限 "postgres" DETAIL:用户没有CONNECT权限。

如何实现连接?


我们需要SSL连接到Heroku之外。请验证是否在客户端中强制使用SSL。

在这里回答得更彻底:在Heroku上连接pgAdmin3到Postgres

我们不允许连接到postgres数据库,因此请确保将Maintenance DB设置为您的数据库名称,并确保使用SSL。


在pgAdminIII中打开Heroku服务器的“Properties”,将“Maintenance DB”的值更改为要连接的数据库的名称。

默认设置适用于dba等可以连接到服务器上任何数据库的人,但显然在您的情况下不是这样。


将维护数据库更改为您的数据库名称,例如dva70000p0090。这应该有用。


在你按照上面araqnid的回答修改了维护数据库名称后,你还应该将你的数据库添加到DB restrictions字段中,因为如果没有这个,你将会看到成千上万的数据库,如果列表太长,你可能无法在列表中找到你的数据库。

更多细节在这里-如何隐藏数据库,我不允许访问


这是针对pgAdmin 4的

为了将pgAdmin连接到数据库(Heroku中的postgres实例),请执行以下操作:

Login to Heroku, and select the application in which you have the database Select the Resources tab and then click on "Heroku Postgres Ad-on" (see below). This will open up a new tab. Select the Settings tab and then click on "View Credentials..." (see below) You will get the following information that you will use in pgAdmin: Go to pgAdmin, and create a new server In the General tab, give a useful name In the Connection tab, fill the info you got at Heroku In order to avoid seeing thousands of databases, you need to add your database name to DB restriction in the Advanced tab (see below)


数据库密码local不是相同的数据库密码heroku。请检查heroku IP postgtres地址和extra