【发布时间】:2018-03-16 01:56:20
【问题描述】:
我似乎无法访问我的 posgresQL 数据库的超级用户帐户。
使用命令:
psql -U postgres
我成功登录到用户“postgres”。但是,这不是默认的超级用户。正在做:
=# \du
我明白了:
List of roles
Role name | Attributes | Member of
-----------+-------------------------------------+-----------
pgsql | Superuser, Create DB | {}
postgres | Create role, Create DB, Replication | {}
所以 'pgsql' 似乎是我的默认超级用户。
尝试时:
psql -U pgsql
我收到以下错误:
psql: FATAL: database "pgsql" does not exist
我将 pg_hba.conf 文件更改为以下内容:
# Database administrative login by Unix domain socket
local all all trust
也试过了:
# Database administrative login by Unix domain socket
local all pgsql trust
但我仍然得到同样的错误,数据库'pgsql'不存在。
任何帮助将不胜感激,我需要能够访问数据库的超级用户。
【问题讨论】:
标签: postgresql psql superuser