我的pg_hba.conf内容如下所示:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 trust
然后我创建了一个role和密码
postgres=# create role asunotest;
CREATE ROLE
postgres=# alter role asunotest with encrypted password '1234';
ALTER ROLE
然后报了以下的错误:
-bash-4.2$ psql -h 127.0.0.1 -U asunotest
Password for user asunotest: 1234
psql: FATAL: role "asunotest" is not permitted to log in
后来通过几行命令完美解决问题。
获取解决方法请阅读全文
未经允许不得转载!完美解决psql: FATAL: role "xxx" is not permitted to log in