I want to connect my posgresql database using remote ip address but i am getting an error.
psycopg2.OperationalError: connection to server at "178.56.25.266", port 5432 failed: Connection refused (0x0000274D/10061)
Is the server running on that host and accepting TCP/IP connections?
here also i am sharing my python code.
import psycopg2
conn = psycopg2.connect(database="test", user='postgres', password='', host='178.56.25.266')
cursor = conn.cursor()
cursor.execute("select version()")
data = cursor.fetchone()
print("Connection established to: ",data)
conn.close()
Please help me to resolve this problem.