Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql Windows, is there a default password? [closed]

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?

like image 824
Joe Avatar asked Sep 09 '13 13:09

Joe


People also ask

What is the default password for postgres Windows?

There is no 'default' PostgreSQL username/password. The credentials supplied in the install process are also used to make these accounts. If you know that username and password you might be able to use the same password to log into PostgreSQL.

Does postgres have a default password?

Login and Connect as Default User For most systems, the default Postgres user is postgres and a password is not required for authentication. Thus, to add a password, we must first login and connect as the postgres user.

Where is postgres password stored Windows?

On Microsoft Windows the file is named %APPDATA%\postgresql\pgpass. conf (where %APPDATA% refers to the Application Data subdirectory in the user's profile). Alternatively, the password file to use can be specified using the connection parameter passfile or the environment variable PGPASSFILE .

What is the default user for PostgreSQL?

The default username for postgres is postgres. (If you are using Advanced Server it is enterprisedb.) On a Mac or Windows, you are able to connect to the default instance by simply hitting enter at the shell or command prompt when trying to run psql and keying in the password.


1 Answers

Try this:

Open PgAdmin -> Files -> Open 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.

Reference

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 
like image 165
heretolearn Avatar answered Nov 07 '22 20:11

heretolearn