我的 PostgreSQL 8.4 服务器中有 20 多个数据库。有人对我的 Postgres 做错了什么,它不再打开了。它给出了以下错误:
error connecting to the server fatal role postgres is not permitted to log in
我做了很多工作来恢复它,但它仍然无法正常工作。我在 Windows XP 中安装了 PostgreSQL 服务器 8.4。
pg_hba.conf
文件配置为:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local connections:
#local all postgres ident sameuser
host all all 127.0.0.1/32 trust
#host all postgres trust
#host all all 192.168.44.12/32 trust
#host all all 192.168.44.103/32 trust
# IPv6 local connections:
#host all all 192.168.44.18/32 trust
# host all all ::1/128 md5
我怀疑问题出在这里是因为有人在NOT LOG IN
中修改了Postgres用户的ROLE
...
最佳答案
可能会尝试单用户模式。停止 postgres,然后从命令行运行它:
postgres --single -D path/to/your/postgres/directory
然后:
ALTER ROLE postgres WITH LOGIN
使用 Ctrl-D 终止 session 。
这应该允许 postgres
用户再次登录到服务器。
关于postgresql - PostgreSQL 服务器 8.4 中的 Postgres 重置密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15170658/