简体   繁体   English

使用Navicat连接到Heroku Postgres数据库

[英]Connecting to Heroku Postgres Database using Navicat

I'm using Navicat to connect to Postgres running on my Heroku application. 我正在使用Navicat连接到在Heroku应用程序上运行的Postgres。 I entered the correct Host, Port, Database Name, User, Password, but I'm getting the following connection error: 我输入了正确的主机,端口,数据库名称,用户,密码,但是出现以下连接错误:

在此处输入图片说明

I searched for the solutions to this error, and I modified pg_hba.conf by adding this line: 我搜索了此错误的解决方案,并通过添加以下行修改了pg_hba.conf

host all all 0.0.0.0/0 md5

also I uncommented the following lines in postgres.conf: 我也没有评论postgres.conf中的以下几行:

listen_address = '*'
port = 5432             # (change requires restart)
max_connections = 100       # (change requires restart)

I restarted Postgres, but Navicat still gives me the same error. 我重新启动了Postgres,但是Navicat仍然给我同样的错误。

I thought the issue could have been the SSL settings, so I followed this manual: http://www.navicat.com/manual/online_manual/en/navicat_datamodeler/win_manual/SSLCert.html 我认为问题可能出在SSL设置上,所以我遵循了本手册: http : //www.navicat.com/manual/online_manual/en/navicat_datamodeler/win_manual/SSLCert.html

Nevertheless, I am getting the same error. 但是,我遇到了同样的错误。

Can anyone assume what the problem is? 任何人都可以假设问题出在哪里吗?

When you're setting up the Connection Properties, after you've filled out the information under the General tab (Host Name/IP Address, Port, Default Database, Username, and Password), click on the SSL tab. 设置连接属性时,在“常规”选项卡下填写了信息(主机名/ IP地址,端口,默认数据库,用户名和密码)后,请单击“ SSL”选项卡。

Check Use SSL and under the dropdown list titled SSL Mode select require . 选中Use SSL然后在标题为SSL Mode的下拉列表中选择require

Then test the connection. 然后测试连接。 Your connection should be successful. 您的连接应该成功。

Ok, it seems you have same issue I do on Mac OS version of Navicat. 好的,看来您在Mac OS版本的Navicat上遇到了同样的问题。 I tried everything to fix also, and pgadmin was working just fine. 我也尝试了所有修复方法,并且pgadmin运行正常。 The solution was to create a new connection as somehow this connection is corrupted and there is nothing you can do to fix it seems in the UI that I could find. 解决方案是创建一个新的连接,因为该连接以某种方式损坏了,您无能为力,无法修复它在用户界面中出现的问题。

Try connect using SSL. 尝试使用SSL连接。 Works for me. 为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM