美文网首页
psql: FATAL: Peer authenticatio

psql: FATAL: Peer authenticatio

作者: 沙漠中的猴 | 来源:发表于2018-11-13 17:34 被阅读0次

解决方法

sudo vim /etc/postgresql/9.5/main/pg_hba.conf

将下面的内容:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

改为:

# Database administrative login by Unix domain socket
local   all             postgres                                trust

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

相关文章

网友评论

      本文标题:psql: FATAL: Peer authenticatio

      本文链接:https://www.haomeiwen.com/subject/rwblfqtx.html