20

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.

Chin
  • 8,013

10 Answers10

12

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

TomEus
  • 3,793
10

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:

Source: https://stackoverflow.com/a/14588440/645016

sxc731
  • 475
6

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.

Uwe Keim
  • 2,112
rajat
  • 61
4

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

Jim
  • 41
  • 1
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.

Jakuje
  • 10,827
dcomp
  • 11
0

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

0

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
-1

User and Password pgAdmin 4.

User: admin@user.com Password: 123456

-2

I tried "root11" as password and it worked!

Jerry
  • 1
-3

For PostgresSQL version 9.5.1_1 on Windows 10, default password is "sa"

Rob
  • 1