1

Recently, I have installed PostgreSQL 9.3 on my windows 7 64 bit PC but today I have formatted my PC. Now again I tried to install PostgreSQL 9.3 but after installation when I tried to connect it throws error See below screenshot :-

enter image description here

My pg_hba.conf is shown below :

enter image description here

I have also saw Postgres password authentication fails but nothing helps.

I am new to PostgreSQL,please help me on this.

Community
  • 1
  • 1
Rakesh Shetty
  • 4,548
  • 7
  • 40
  • 79
  • 1
    You're using the wrong password. If you've lost/forgotten your password, you can change `pg_hba.conf` to use `trust` for long eough to reset it - see "reset postgres password". – Craig Ringer Jul 11 '14 at 05:26
  • @CraigRinger I have used the password which I have put during installation. Should I change method = Trust on pg_hba.conf ? – Rakesh Shetty Jul 11 '14 at 05:27
  • @CraigRinger I have change that to trust and restart but still it is asking for password and when I put the password it shows "role rakesh does not exist" – Rakesh Shetty Jul 11 '14 at 05:36

1 Answers1

1

Finally I found the solution hope this will help to other users if they are facing the same problem :-

I have to edit pg_hba.conf file which is located in "C:\Program Files\PostgreSQL\9.3\data". In that file I have to make method md5 to trust as @Craig Ringer said. So the line will look like host all postgres 127.0.0.1/32 trust.

Then to restart the PostgreSQL on windows - Go to start > run > services.msc then restart the service.

Then open pg Admin create new server enter all the required details and save it. That's it !!

Rakesh Shetty
  • 4,548
  • 7
  • 40
  • 79