This has been doing my head in all day – so hopefully it will save some of you the trouble. I’m on a CentOS box.
First thing you want to do is check which version of postgres you have, with:
Which will give you something like:
So with that info you will know which pg_hba.conf to open, for 9.2 it’s:
In that file, change this line:
Then, at the command type:
Which will let you log in as postgres, then set your new password with:
And then go back to your pg_hba.conf file with:
And change this line:
And that’s it – done!