Heroku Database Connection Properties

heroku, heroku-postgres

Solution

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.

Problem

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?

Original source

Related problems