【问题标题】:Postgres reset password in PostgreSQL server 8.4Postgres 在 PostgreSQL 服务器 8.4 中重置密码
【发布时间】:2013-07-17 15:37:57
【问题描述】:

我的 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 用户之外,您是否创建了任何其他用户?
  • 是的,我创建了,但我不记得用户名了。
  • 你的 pg_hba.conf 允许所有用户连接;你的 Postgres 二进制文件中有一个 createuser.exe 程序吗?

标签: postgresql


【解决方案1】:

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

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

然后:

ALTER ROLE postgres WITH LOGIN

使用 Ctrl-D 终止会话。

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

【讨论】:

  • 同样的错误来了 postgres is not allowed to login while create new user through createuser.exe
  • 添加单用户模式注释。
  • 我收到一个错误 Postgres 不是内部或外部命令、可运行程序或批处理文件
  • 我在cmd中给出的命令是.. postgres --single -D C:\Program Files\PostgreSQL\8.4\bin\postgres.exe
  • 非常感谢@cfeduke 我的问题已经解决了............愿上帝永远保佑你......
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-01-11
  • 2015-05-14
  • 1970-01-01
  • 1970-01-01
  • 2015-04-19
  • 2018-01-21
  • 1970-01-01
相关资源
最近更新 更多