我无法连接到我的本地服务器上的自己的Postgres数据库。我搜索了一些类似的问题,并找到了这个手册:https://help.ubuntu.com/stable/serverguide/postgresql.html
所以:
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
然后我创建一个用户并为其分配密码: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
,我该如何修改角色(ALTER ROLE)? - Romulus Urakagi Ts'ai