What is the default password for the "postgres" user when I install postgreSQL on Windows? I googled for "postgres default password" but it doesn't return any immediate result.
10 Answers
There is no default password on Windows - the install will ask you during the wizard to create one. If you forgot or don't remember you can:
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
- 3,793
For those on Linux (Ubuntu here; should work identically with other distros), you can simply run the psql CLI under user postgres (using sudo) and set the password from there; eg:
$ sudo -u postgres psql
psql (14.1 (Ubuntu 14.1-2.pgdg20.04+1))
Type "help" for help.
postgres=# \password postgres
Enter new password:
Enter it again:
- 475
Though it's late, putting it across:
By Default, the user is 'postgres' and the password is the one which you enter while installing the database. (Version 11,12 I have tested).
Issuing the command:
psql
from cmd in windows will ask for the password of User (Logged in) which might not be available. So you can try login with postgres user:
psql -U postgres
and enter the password used while installing.
Or create a user with login permissions using PgAdmin tool.
On a default Windows installation you must specify a database name and you have the option to change the hostname, the username, and the password.
Defaults are: Host name : localhost, Database name : <wasyourchoice>, User name : openpg, Password : openpgpwd
- 41
- 1
This depends on what version of PostgreSQL you installed on windows. For versions before 9.2, the default password should be empty. However, for versions after 9.2, the PostgreSQL installer installs with the the special NT AUTHORITY\NetworkService, and the postgres account isn't created.
If you want to use the "postgres" default user in windows, you need run the installer with the --serviceaccount postgres option. This is documented in their installation-notes.html file located in the doc folder after you install.
go to control >> computer management >> Locaol users and group >> users >> right click on openpgsvc >> set password.
after that now you can access with this password on openpgsvc
to reset your password enter this from the Command Prompt. accountname is your username. newpassword is the password you are changing it to.
net user accountname newpassword