【发布时间】:2016-02-13 17:22:27
【问题描述】:
我在 Ubuntu 中安装了 PostgreSQL 9.3,并创建了一个新用户“myuser”。事实上,如果我写 psql -U postgres -c'\du+' 我会得到
List of roles
Role name | Attributes | Member of | Description
----------+------------------------------------------------+-----------+-------------
postgres | Superuser, Create role, Create DB, Replication | {} |
myuser | | {} |
现在我想修改“myuser”的密码,然后创建一个新数据库。所以我写了
psql \password myuser
Password for user myuser: bla bla...
但我得到了错误
psql: FATAL: password authentication failed for user "myuser"
但我不记得以前创建过密码。好的,没问题。我决定删除这个用户,所以我写道:
dropuser myuser
Password: what? bla bla...
dropuser: could not connect to database postgres: FATAL: password authentication failed for user "strange_user"
strange_user 是一个花哨的名字……但我不知道是谁……有办法解决这个问题吗?
我的 pg_hba.conf 是:
# Database administrative login by Unix domain socket
local all postgres md5
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
【问题讨论】:
-
你能发布你的 pg_hba.conf 吗?
-
是的,我编辑了原始消息
标签: postgresql ubuntu ubuntu-14.04 postgresql-9.3