psql: FATAL: Ident authentication failed for user"mypguser"
请编辑你的pg_hba.conf,这个文件一般位于
请编辑你的pg_hba.conf,这个文件一般位于
/etc/postgresql/X.Y/main/pg_hba.conf
,X.Y是你的PostgreSQL的版本号,将下面行的peer改为trust:
local all all trust # replace ident or peer with trust
- 如果出现下面的错误:
psql: FATAL: Peer authentication failed foruser "mypguser"
请仍然修改pg_hba.conf文件,该下面行的peer为md5:
完成上面的修改后请重新加载postgresql:
local all all md5 # replace peer with md5
/etc/init.d/postgresql reload