Heroku数据库连接属性 [英] Heroku Database Connection Properties
问题描述
我试图执行一项相对简单的任务:我想连接到一个Heroku数据库。我已经创建了数据库,并且已经从Heroku站点发布了证书。但是,当我尝试使用任何连接到此数据库,除了终端的'heroku'命令行客户端,我发现致命错误或无法连接错误。
我尝试在Heroku终端应用程序之外连接的两个工具是:Navicat和IntelliJ。
在Navicat尝试连接时收到的错误到数据库是:
无法连接到服务器:主机已关闭
服务器在主机上运行ec2-107- 21-112-215.compute-1.amazonaws.com并在端口5432上接受
TCP / IP连接?
我的连接设置如下:
连接名称 Heroku Dev测试
主机名称/ IP地址 ec2-107-21-112-215.compute-1.amazonaws.com
端口 5432
Navicat似乎没有尝试连接到该主机名。
当我尝试使用完全凭证连接IntelliJ时,出现以下错误:
$ b
java.sql。 SQLException:FATAL:主机75.168.4.146,用户rphbqggxeokuxl,数据库dc008iqk0rq4j5,SSL off
同样,我使用Heroku应用程序在他们的网站上访问我的数据库时提供的凭据。
有没有人遇到过Heroku连接问题? / p>
Heroku提供以下信息用于连接外部资源: 一个href =https://devcenter.heroku.com/articles/heroku-postgresql#external-connections-ingress> https://devcenter.heroku.com/articles/heroku-postgresql#external-connections-ingress
第二个错误消息表明PostgreSQL没有配置为接受你正在尝试创建的连接。根据Heroku提供的信息,一个好的猜测是你没有连接SSL。尝试在您的连接上启用该功能。
以下是有关在Navicat中使用SSL的说明:http://mirror.navicat.com/manual/online_manual/en/navicat/rv_manual/ClientCert.html 。
这可能有助于配置Intellij以使用SSL: https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java#connecting-to-a-database-remotely 一>。
I'm trying to perform a relatively trivial task: I want to connect to a Heroku database. I have created the database and have been issued credentials from the Heroku site. However, when I try to connect to this database using anything besides the terminal 'heroku' command line client, I get fatal errors or cannot connect errors.
The two tools that I tried to connect with outside of the Heroku terminal application are: Navicat and IntelliJ.
The error that I receive in Navicat when trying to connect to the database is:
could not connect to server: Host is down
Is the server running on host "ec2-107-21-112-215.compute-1.amazonaws.com" and accepting
TCP/IP connections on port 5432?
My connection settings are as follows:
Connection Name Heroku Dev Test
Host Name/IP Address ec2-107-21-112-215.compute-1.amazonaws.com
Port 5432
Navicat doesn't even seem to be making an attempt to connect to that hostname.
When I try to connect with IntelliJ, using the full credentials, I get the following error:
java.sql.SQLException: FATAL: no pg_hba.conf entry for host "75.168.4.146", user "rphbqggxeokuxl", database "dc008iqk0rq4j5", SSL off
Again, I'm using the credentials that the Heroku application provides me with when accessing my database on their website.
Has anyone ran into this Heroku connection issue before?
Heroku provides this information for connecting from external sources:
https://devcenter.heroku.com/articles/heroku-postgresql#external-connections-ingress
The second error message indicates PostgreSQL is not configured to accept the connection you're trying to make. Given the information Heroku provides, a good guess is that you're not connecting with SSL. Try to enable that on your connection.
Here are instructions for using SSL with Navicat: http://mirror.navicat.com/manual/online_manual/en/navicat/rv_manual/ClientCert.html.
This may be helpful in configuring Intellij to use SSL: https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java#connecting-to-a-database-remotely.
这篇关于Heroku数据库连接属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!