15

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 10

11

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

2
  • 3
    for me the default password was postgres for postgres user. Using V12.
    – shashwat
    Sep 3, 2020 at 14:14
  • 2
    no user called posgres is created with windows installer.
    – Dawesi
    Nov 22, 2021 at 12:59
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.

1
  • please, how can one set a password for the User (logged in) to use the psql command?
    – oyeyipo
    Jan 6, 2023 at 14:07
5

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

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

1
  • Just installed Odoo Community v15 on Windows and this was the correct password. Nice! Aug 20, 2022 at 20:24
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.

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

-1

User and Password pgAdmin 4.

User: [email protected] Password: 123456

0
-2

I tried "root11" as password and it worked!

-3

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .