postgres连接数据库进行数据连接时出现下面着这样的错误:

psycopg2.OperationalError: FATAL: password authentication failed for user

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

conn = _connect(dsn, connection_factory=connection_factory, **kwasync)

psycopg2.OperationalError: FATAL:  password authentication failed for user "postgres" - - -

 

 

 

这是我的解决方案:

 

首先进入postgresql更改pg_hba.conf配置:

 

全部改为trust,然后重启服务器,就可以连接使用了

 

psycopg2.OperationalError: FATAL: password authentication failed for user

 

 

 

 

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄