gpt4 book ai didi

windows - postgres 9.2 忘记密码

转载 作者:行者123 更新时间:2023-11-29 14:37:47 26 4
gpt4 key购买 nike

我是 PostgreSQL 的新手,当我打开 pgAdmin III 并尝试连接与 PostgreSQL 9.2 (x86) localhost

它问我用户 openpg 的密码:(我们忘记了)

如果有人好心帮助我重置我们数据库的密码(在 Windows 平台上),我将不胜感激?

感谢和问候

最佳答案

在顶部添加一行:

local    postgres     postgres     trust

C:\Program Files\PostgreSQL\8.4\data\pg_hba.conf

重新启动/重新加载 postgres...

登录到 postgres...不需要身份验证...

ALTER USER postgres PASSWORD 'new_password';

其中 postgres 是用户名...

然后最后编辑我们在开头添加的行...

local    postgres     postgres     md5

再次重启 postgresql... 现在您应该可以使用您输入的新密码登录...


如果上述方法不起作用...将以下内容添加到配置文件 pg_hba.conf...

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host postgres postgres 127.0.0.1/32 trust
# IPv6 local connections:
host postgres postgres ::1/128 trust

然后重新加载配置或重启服务...现在您可能无需密码即可登录...更改密码...

如果可行...最后,不要忘记将“trust”替换为“md5”...

关于windows - postgres 9.2 忘记密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41777611/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com