I have been using a postgres database with pgAdmin3, and have never had any issues with connecting to the database. Today I tried accessing the database through Python using the following code:
import psycopg2
conn_string = "dbname='db0r0373s42fkg' user='ucaj9jki7hfthu' host='ec2-107-20-189-29.compute-1.amazonaws.com' password='secret'"
conn = psycopg2.connect(conn_string)
conn.close()
and I get the following error:
FATAL: no pg_hba.conf entry for host "207.204.247.209", user "ucaj9jki7hfthu", database "db0r0373s42fkg", SSL off
From looking around this site, it seems that error occurs when the database is not set up to allow me to sign in with these credentials, but why does it work through pgadmin but not Python?
I saw another post with a similar question(Psycopg2 reporting pg_hba.conf error), but I didn't quite understand their answer and I'm not sure if I'm having the same problem Thanks so much for your help.