Password auth Error on a localhost pgdatabase running on docker container

36 views Asked by At
OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: FATAL:  password authentication failed for user "root"

I expect a successful connection, however that has not been the case. Docker containers are up and running but I am unable to create that connection using:

from sqlalchemy import create_engine
engine = create_engine(f"postgresql://{user}:{password}@{host}:{port}/{dbname}", echo_pool="debug")
con = engine.connect()

I have verified login credentials over and over and I still don't understand/know how to get pass this.

0

There are 0 answers