Cannot connect to Heroku database "no pg_hba.conf entry"
Hi All,
I am trying to connect to my Heroku databse and I am getting the fokkowing error.
FATAL: no pg_hba.conf entry for host "192.......
It says it is connectd but username/password incorrect , but they are.
The databse url is got from Heroku. The same data works fine with pgAdmin.
Version : 138.1400.3
I think it might be the fact these are shared databases - but not sure.
Thoughts?
Geoff
Please sign in to leave a comment.
Hello.
When connecting from 0xDBE, and from pgAdmin, do you use the same login and connect from the same PC?
Thanks,
Alexander.
Yes I do.
Here is an example that does not work for me: this is an empty DB
postgres://rulbbxyqkdqacl:Y06-N1Kzidv5WiIYJKpWX1uZHg@ec2-54-204-36-244.compute-1.amazonaws.com:5432/d9ihqiaijc5is7
Best
Geoff
I tried your URL. However, I have to change "postgres:" to "jdbc:postgresql:" and move user and password to corresponding fields. Otherwise it didn't work in 0xDBE. Are you using PostgreSQL driver type, and jars downloaded by 0xDBE?
(Then I've got the same error about pg_hba.conf. But that's not surprise on my side, since pg_hba can be configured to allow selected IPs to connect, and my IP may be blocked. Some information, if needed: http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html )
Regards,
Alexander.
Hi Alexander,
Yes I did move the username/password to the correct slots.
The DB is maintained by Heroku - so probably that have it locked down.
I did download all the jars as prompted by the app. The app connects, just not authorized.
pgAdmin just works - I have attached a shot of the config screen from it in case that helps.
I think the putting of the DB into the "service db" might be unusual
Added my 00dbe config screen as well
Plus the driver screen
Best
Geoff
Attachment(s):
Screenshot 2014-08-05 12.55.14.png
Screenshot 2014-08-05 13.05.20.png
Screenshot 2014-08-05 13.07.19.png
I had the same problem yesterday. You need to add a querystring to the end of your connection string specifying that ssl should be used:
jdbc:postgresql://server:5432/db?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
Look at the "Connecting to a database remotely" section here:
https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java#connecting-to-a-database-remotely
Thanks - that got it.
Geoff
Hi, I'm now currently trying to connect to the Heroku Database. However, apparently there's now no option to specify the connection string? Or maybe I misunderstood something:
I'm getting the same error about "no pg_hba.conf entry, ... SSL off"
The URL input box appears when I choose "Custom" instead of "PostgreSQL" in the dropdown menu to create a new data source. If one chooses "PostgreSQL" it seems to hide the URL input box and uses preset values. After manually inputting the URL as specified it works.
thanksss Xiang ji it works! i was trying to connect from dbeaver and i had the same problem. it solves choosing jdbc connection
hey, I was unable to get this works modifying the Url as Cory Dingels said. So I found configuration for this field in Advanced tab and this works perfect: