Postgresql Windows,有默认密码吗? [英] Postgresql Windows, is there a default password?

查看:381
本文介绍了Postgresql Windows,有默认密码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅在Windows 7上安装了Postgresql。在安装过程中,不要求我设置密码。运行psql时,要求输入密码。用谷歌搜索一些,唯一可能的默认密码是 postgre。但这没用。还尝试了一个空白密码和我的Windows密码。他们俩都没有工作。阅读一些高级文章,了解如何重设密码,但这不对吗?我在这里想念什么?我应该输入什么密码?

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?

推荐答案

尝试一下:

Open PgAdmin -> Files -> Open pgpass.conf

您将获得 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.

参考

如果上述方法无效,则可以考虑尝试:

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

这篇关于Postgresql Windows,有默认密码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆