连接数据库时,报如下错误:

psql: fatal: ident authentication failed for user "dbuser"

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

解决方法:

修改认证权限配置文件 /var/lib/pgsql/9.6/data/pg_hba.conf

原来:

# IPv4 local connections:
host all all 127.0.0.1/32  ident 修改为: # IPv4 local connections:
host all all 127.0.0.1/32  password

命令行重启服务:password service postgresql-9.6 restart

即可连接。

 

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