postgresql - PostgreSQL 服务器 8.4 中的 Postgres 重置密码

标签 postgresql

我的 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/

相关文章:

ruby-on-rails - 如何通过 Rails App 检查 postgres 服务器是否启动?

postgresql - 错误触发器。触发不返回。数据库

sql - 在PostgreSQL中,我们可以直接比较两个带有不同时区的时间戳吗?

Python psycopg2 PostgreSQL 尝试解除分配

mysql - 在 PGSQL 中模拟 MySQL 的 substring_index()

postgresql - 使用 Liquibase、postgreSQL 和序列插入新数据

带有年份和周数的 Postgresql 日期范围查询

database - 如何在postgreSQL中获取用户定义的函数注释

postgresql - Postgres + postgis 中 x,y 坐标集合的凸包生成

python - 使用 Postgres 在 Python 中用单引号形成插入语句