ewcvis
ewcvis

Reputation: 149

psycopg2.OperationalError: could not translate host name "xxxxxx.us-east-1.rds.amazonaws.com" to address: Unknown host

I am unable to connect to the PostgreSQL database through psycopg2 for some reason

here is my connection configuration:

conn = psycopg2.connect(
    user = "postgres",
    password = "xxxxxx",
    host = "xxxx.us-east-1.rds.amazonaws.com",
    database = "current2",
    port = 5432
)

I put sensitive information in x's, but ignoring that, what exactly am I doing wrong?

Upvotes: 3

Views: 8325

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247665

That is an error with your domain name resolution (DNS) setup and has nothing to do with the database. The DNS server you have configured on your system cannot resolve the host name.

Either use a different DNS server, or use the database server's IP address.

Upvotes: 2

Related Questions