在 Windows 上安装 PostgreSQL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/550758/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:58:50  来源:igfitidea点击:

Installing PostgreSQL on Windows

windowspostgresqluser-accounts

提问by Ross

I'm in a bit of a mess here. I installed PostgreSQL on my Vista computer a couple of days ago but then when asked to enter the password for the postgre user account I couldn't remember it (allegedly I was asked during setup but I don't remember that).

我这里有点乱。几天前我在我的 Vista 计算机上安装了 PostgreSQL,但是当被要求输入 postgre 用户帐户的密码时,我不记得了(据说我在安装过程中被问到,但我不记得了)。

Anyway, so I uninstalled Pg with the intention of reinstalling it, removed the user account, it's /Users/ directory and it's special privelleges ("Advanced user profile properties") but when I come to install Pg it seems to think the account still exists as when I supply a password during setup it says that it is not the correct password - meaning that the account still exists somewhere.

无论如何,所以我卸载了 Pg 打算重新安装它,删除了用户帐户,它是 /Users/ 目录和它的特殊权限(“高级用户配置文件属性”)但是当我开始安装 Pg 时,它似乎认为该帐户仍然存在当我在设置过程中提供密码时,它说它不是正确的密码 - 这意味着该帐户仍然存在于某处。

Is there anyway I can recover this?

无论如何我可以恢复这个吗?

采纳答案by liggett78

Go to Control Panel -> Administrative Tools -> Computer Management. There under "Local Users and Groups" you can see all users created for your system. Remove "postgres" and reinstall PostgreSQL.

转到控制面板 -> 管理工具 -> 计算机管理。在“本地用户和组”下,您可以看到为您的系统创建的所有用户。删除“postgres”并重新安装 PostgreSQL。

回答by Arun S

Open a command prompt with the administrator rights. i.e. Right click on command prompt icon -> Run as Administrator

以管理员权限打开命令提示符。即右键单击命令提示符图标 -> 以管理员身份运行

Use the following command to change the password:

使用以下命令更改密码:

!important: CASE and SHOULD BE RUNNING AS ADMINISTRATOR

!important: CASE 并且应该以管理员身份运行

NET USER postgres <NEW_PASSWORD>  

回答by moysoft

On Vista you can go to Control Panel -> User Accounts -> Manage Another Accounts then select user postgres, change the password if you forget your last password.

在 Vista 上,您可以转到控制面板 -> 用户帐户 -> 管理其他帐户,然后选择用户 postgres,如果您忘记了上一个密码,请更改密码。