su postgres: Sorry?

matt picture matt · Oct 14, 2011 · Viewed 33.8k times · Source

i have a problem with my postgreSQL setup on my new Mac OSX Lion machine.

I can't seem to connect to the service

$ createuser -a -d _postgres
Password: 
createuser: could not connect to database postgres: FATAL:  password authentication failed for user 

I have no chance to find the correct password. Any idea what could that be. I have the default setup with a localhost server. The same happens when I try to connect via pgAdmin.

$ su postgres
Password:
su: Sorry

I have no chance to find out what's wrong?

Answer

jishi picture jishi · Oct 14, 2011

try this:

$ sudo su postgres

And specify your own password.