I could use psql –host=myrds.crypticxxxx.us-east-1.rds.amzaonaws.com -port=5432 -username=’devuser’ -dbname=’postgre’.
but in the same terminal, with python3 3.7.16 with Amazon Linux 2, and python3 database package psycopg2.
after importing modules and make a connection like :
conn = psycopg2.connect(host=db_host, user=user_name, password=password, database=db_name, port=port_num, connect_timeout=100)
ConnectionERROR: Unexpected error: Could not connect to postgresqldb instance.
connection to server at “myrds.crypticxxxx.us-east-1.rds.amzaonaws.com” (xx.xx.xx.xxx), port 5432 failed: FATAL: password authentication failed for user “devuser”
connection to server at “myrds.crypticxxxx.us-east-1.rds.amzaonaws.com” (xx.xx.xx.xxx), port 5432 failed: FATAL: no pg_hba.conf entry for host xx.xx.xx.xxx, user “devuser”, database “postgre”, no encryption.
What could be the cause for python3 failed to make a connection?
tried with sslmode=’require’ option as well in Python codes. But no connection either