0

我丢失了 PostgreSQL 的密码。我已经尝试过用谷歌搜索一下,但是

local all all trust

解决方案对我不起作用。有谁知道如何以另一种方式恢复/重置此密码?谢谢!

编辑

这是我收到的错误:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

我确实尝试过这里发布的解决方案我忘记了在 postgres 安装期间输入的密码

4

1 回答 1

0

我假设您指的是这里描述的过程:

http://www.postgresqltutorial.com/postgresql-reset-password/

实际上所描述的过程有点错误,因为您不应该在注释行之后添加“local all all tr​​ust”行,而是将所有方法从“md5”修改为“trust”。这样做我可以在不指示密码的情况下连接到服务器,然后我可以重置密码。

在 Windows 上,我必须将“托管所有所有 127.0.0.1/32 md5”行更改为“托管所有所有 127.0.0.1/32 信任”。

希望有帮助

于 2019-06-27T10:32:15.437 回答