创建了用户testdb1。发布:
postgres=# alter user testdb1 with password 'testdb1';
ALTER ROLE
postgres=#
然后在 pg_hba.conf 中添加一个条目:
local all testdb1 password (also tried md5)
但当我尝试连接时:
psql -U testdb1 -W
Password for user testdb1: (type in password here)
psql: FATAL: Peer authentication failed for user "testdb1"
我还缺少什么?
答案1
我添加的行:
local all testdb1 md5
需要位于预先存在的行之前:
local all all peer