PostgreSQL服务器8.4中的Postgres重置密码 [英] Postgres reset password in PostgreSQL server 8.4

查看:106
本文介绍了PostgreSQL服务器8.4中的Postgres重置密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的PostgreSQL 8.4服务器中有20多个数据库。有人对我的Postgres做错了,它不再打开了。它给出以下错误:

I have more than 20 databases in my PostgreSQL 8.4 server. Someone did something wrong to my Postgres and it is not opening anymore. It gives the following error:

error connecting to the server fatal role postgres is not permitted to log in

我做了很多事情来恢复它,但仍然无法正常工作。我在Windows XP中拥有PostgreSQL服务器8.4。

I did lot to recover it but it still not working. I have PostgreSQL server 8.4 in windows XP.

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

我怀疑问题出在这里,因为有人修改了中Postgres用户的 ROLE 不登录 ...

I suspect that the problem is here because someone modified the ROLE of Postgres user in NOT LOG IN...

推荐答案

可能尝试单用户模式。停止postgres,然后从命令行运行它:

Possibly try single user mode. Stop postgres, then run it from the command line:

postgres --single -D path/to/your/postgres/directory

然后:

ALTER ROLE postgres WITH LOGIN

使用 Ctrl-D 终止会话。

这应该允许 postgres 用户再次登录服务器。

That should allow the postgres user to log into the server once again.

这篇关于PostgreSQL服务器8.4中的Postgres重置密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆