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 Python 3.7.16, with Amazon, Linux 2, and the Python 3 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 Python 3 to fail to make a connection?
Tried with the sslmode='require' option as well in Python codes. But there was no connection either.
sslmode='require'