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設置不起作用?