0
PostgreSQL的10.0,Ubuntu的16.04MD5认证本地用户
我想用户在本地主机与密码登录。 为此,我将md5的规则移至顶端。
SHOW hba_file;
postgres=# # TYPE DATABASE USER ADDRESS METHOD
postgres-#
postgres-# # IPv4 local connections:
postgres-# host all all 127.0.0.1/32 md5
postgres-# # "local" is for Unix domain socket connections only
postgres-# local all all peer
postgres-# # IPv6 local connections:
postgres-# host all all ::1/128 md5
postgres-# # Allow replication connections from localhost, by a user with the
postgres-# # replication privilege.
postgres-# local replication all peer
postgres-# host replication all 127.0.0.1/32 md5
postgres-# host replication all ::1/128 md5
然后重新启动该服务:
sudo service postgresql restart
问题:
[email protected]:~$ psql -U admin -W
Password for user admin:
psql: FATAL: Peer authentication failed for user "admin"
你能告诉我为什么我的MD5设置不起作用?