sql - postgres 9.3 windows 的空密码登录失败

标签 sql windows postgresql null passwords

我将本地计算机上用户 postgres 的 postgres 密码更改为 NULL。在 SQL 窗口中使用以下命令: 更改角色 postgres 密码为空;

现在,我无法再次登录,因为它要求输入密码并且不接受任何内容。我无法运行 SQL 查询来更改密码,因为我现在没有登录。我可以在 Windows 命令提示符下执行某些操作来改回密码吗?

最佳答案

您可以编辑 pg_hba.conf 文件以启用 trust(无密码)localhost 的身份验证方法。详情在这里:http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html

添加

host    all             all             127.0.0.1/32            trust

pg_hba.conf 文件的开头将启用从 127.0.0.1/32 (localhost) 的无密码登录

关于sql - postgres 9.3 windows 的空密码登录失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25973750/

相关文章:

asp.net - 限制mysql查询的记录数

.net - 为什么我们需要 SDK 和 .NET Framework?

c++ - 在windows下用mingw编译c libusbmuxd编译

sql - 使用最后一个非空值更新有序行

sql - 如何在 PostgreSQL 中调试公用表表达式?

python - SQL 重新格式化/更改 TableView ,将重复内容作为列

sql - 如果我 SELECT something as a name 然后 something as the same name 会发生什么?

asp.net - EF 4.1异常 "The provider did not return a ProviderManifestToken string"

linux - 自动暂停进程

postgresql - 函数根据参数从两个查询之一返回记录集