Reputation: 395
I used blog entry by Robby on Rails site:
Got to the end, but when I tried accessing the pg database I was denied.
I've tried to change pg_hba.config file to trust so that I can gain access anyway (without a password), but proved fruitless.
Please help. Thanks in advance.
Upvotes: 3
Views: 7920
Reputation: 1273
Restart postgresql after you alter the pg_hba.config file to make sure your changes are read. Next, type
psql -U myUser template1
in a terminal, where myUser
is the name of the user running the postgres proces. That should make you log in as administrator. Next, in the psql session, write
ALTER USER realUser PASSWORD 'myNewPassword';
in order to reset the password. Here realUser
is the user of the database you are trying to connect to.
Upvotes: 3