今天迁移服务器,新服务器安装postgresql后,启动站点后访问报错:
fatal ident authentication failed for user postgres centos 7
查了一下,需要找到 pg_hba.conf 这个配置文件做个修改:
#找到下面这句:
host all all 127.0.0.1/32 ident
#修改为:
host all all 127.0.0.1/32 md5
有的系统不太好找到 pg_hba.conf 配置文件,有个通用方法:
sudo su postgres
然后进入默认的文件夹,就会看到一个 postgresql 版本号的文件夹,进去后再进入data文件夹就找到配置文件了。










网友评论