database 使用 pgadmin 连接到 heroku 数据库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11769860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:38:33  来源:igfitidea点击:

Connect to a heroku database with pgadmin

databasepostgresqlherokupgadmin

提问by Tomas Romero

I would like to manage my heroku database with pgadminclient. By now, I've been doing this with psql. When I use data from heroku pg:credentialsto connect de DB using pgadmin, I obtain:

我想用pgadmin客户端管理我的 heroku 数据库。到目前为止,我一直在用psql. 当我使用 data fromheroku pg:credentials连接 de DB using 时pgadmin,我获得:

An error has occurred:

Error connecting to the server: FATAL: permission denied for database "postgres" DETAIL: User does not have CONNECT privilege.

发生了错误:

连接到服务器时出错:致命:数据库“postgres”的权限被拒绝详细信息:用户没有连接权限。

Any guide on how to achieve the connection?

有关如何实现连接的任何指南?

回答by araqnid

Open the "Properties" of the Heroku server in pgAdminIII and change the "Maintenance DB" value to be the name of the database you want to connect to.

在 pgAdminIII 中打开 Heroku 服务器的“属性”并将“维护数据库”值更改为要连接的数据库的名称。

pgAdmin III - New Server Registration

pgAdmin III - 新服务器注册

The default setup is suitable for DBAs et al who can connect to any database on the server, but apparently that isn't true in your case.

默认设置适用于 DBA 等人,他们可以连接到服务器上的任何数据库,但显然在您的情况下并非如此。

回答by cm12

After you change the Maintenance DB name as suggested by araqnid's answer above, you should also add your database to the DB restrictions field because without this you will see thousands of databases and you may not be able to find yours in the list if the list is too long.

按照上面 araqnid 的回答的建议更改维护数据库名称后,您还应该将数据库添加到数据库限制字段,因为如果没有这个,您将看到数千个数据库,如果列表是,您可能无法在列表中找到您的数据库太长。

More details here - How to hide databases that I am not allowed to access

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

回答by hgmnz

We require SSL for connections outside heroku. Please verify whether you're forcing SSL in your client.

我们需要 SSL 用于 heroku 外部的连接。请验证您是否在客户端中强制使用 SSL。

Edit:

编辑:

Answered more thoroughly here: https://dba.stackexchange.com/questions/21869/connecting-pgadmin3-to-postgres-on-heroku

在这里回答更彻底:https: //dba.stackexchange.com/questions/21869/connecting-pgadmin3-to-postgres-on-heroku

We don't allow connections to the postgresdatabase, so be sure to set Maintenance DB to your database name, and be sure to use SSL.

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

That should hopefully suffice.

这应该足够了。

回答by ravi

Change the Maintenance Database to the name of your Database, e.g. dva70000p0090. This should work.

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