read upload_files from postgres db,but meet the error password authentication failed #12598
Closed
4 tasks done
Labels
🐞 bug
Something isn't working
🤔 cant-reproduce
We can not reproduce it or the information is limited
Self Checks
Provide a description of requested docs changes
the simple code is below, read the db postgres and get the uploadfile information, but meet the password authentication failed.I did not change the username and password in docker-compose.yaml. is this method right?
from sqlalchemy import create_engine,text
username="postgres"
password="difyai123456"
host='0.0.0.0'
port="5432"
dbname="dify"
engine = create_engine(f'postgresql://{username}:{password}@{host}:{port}/{dbname}')
from sqlalchemy.orm import sessionmaker
Session = sessionmaker(autocommit=False,autoflush=False,bind=engine)
session = Session()
session.execute(text("select * from upload_files;"))
test shell :pg_isready -h localhost -p 5432 -U postgres
returns: localhost:5432 - accepting connections
The text was updated successfully, but these errors were encountered: