1

While trying to connect to my ElephantSQL database on Bluemix using pgadmin, it throws the following error.

Access to database denied
The server doesn't grant access to the database: the server reports 
FATAL: no pg_hba.conf entry for host "XX.XXX.XX.XX", user "abcd", database "postgres", SSL on FATAL: no pg_hba.conf entry for host "XX.XXX.XX.XX", user "abcd", database "postgres", SSL off

To access a database on a PostgreSQL server, you first have to grant primary access to the server for your client (Host Based Authentication). PostgreSQL will check the pg_hba.conf file if a pattern that matches your client address / username / database is present and enabled before any SQL GRANT access control lists are evaluated.

How can I access the pg_hba.conf file on bluemix?

enter image description here

0

On ElephantSQL shared plans, make sure that you put your database name (which is the same as your username) in the "Maintenance database" field in PGAdmin. This is explained in the docs. Right now you're trying to connect to the "postgres" database, which you don't have access to on the shared server.

2

The error message means you are already accessing pg_hba.conf. There is just no line granting access for your connection attempt. At least one of your provided details (host, user, database) does not match for any line in the file.

I am not familiar with ElephantSQL, but it seems to be a database hosting service providing standard PostgreSQL. Advice in the manual should apply. Here is a related answer with more explanation and links:

  • Yes, ur right. I see tht its actually seeing the .conffile. But, I cannot see how i could edit it. I mean, bluemix's ElephantSQL console does not give u a portal to edit these files. Is there a way to access these file ?. (I have added a screenshot of the portal- To the main Quesn) – Betafish Jul 26 '15 at 18:17
  • @Betafish: According to the online documentation of ElephantSQL, there should be a connection URL visible ... You might contact the company for assistance. – Erwin Brandstetter Jul 26 '15 at 23:00
  • 1
    It works now. I did contact the company for assistance. – Betafish Jul 27 '15 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.