Postgresql Windows,有默认密码吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18698889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Postgresql Windows, is there a default password?
提问by Joe
Just installed Postgresql on Windows 7. I was not asked to set a password during installation. When i run psql, I'm asked for a password. Googled some and the only possible default password was "postgre". But that didn't work. Also tried a blank password and my Windows password. Neither of them worked. Read some advanced stuff how to reset a password, but this can't be right? What am I missing here? What password am I suppose to enter?
刚刚在 Windows 7 上安装了 Postgresql。我在安装过程中没有被要求设置密码。当我运行 psql 时,我被要求输入密码。搜索了一些,唯一可能的默认密码是“postgre”。但这没有用。还尝试了一个空白密码和我的 Windows 密码。他们都没有工作。阅读一些有关如何重置密码的高级内容,但这不对吗?我在这里缺少什么?我应该输入什么密码?
回答by heretolearn
Try this:
尝试这个:
Open PgAdmin -> Files -> Open pgpass.conf
You would get the path of pgpass.conf
at the bottom of the window.
Go to that location and open this file, you can find your password there.
你会得到pgpass.conf
窗口底部的路径。去那个位置打开这个文件,你可以在那里找到你的密码。
If the above does not work, you may consider trying this:
如果上述方法不起作用,您可以考虑尝试以下方法:
1. edit pg_hba.conf to allow trust authorization temporarily
2. Reload the config file (pg_ctl reload)
3. Connect and issue ALTER ROLE / PASSWORD to set the new password
4. edit pg_hba.conf again and restore the previous settings
5. Reload the config file again
回答by user1731782
On linux the default user is postgres. It has superuser rights and can create other accounts, set passwords etc. Can you try that?
在 linux 上,默认用户是 postgres。它具有超级用户权限,可以创建其他帐户、设置密码等。你能试试吗?