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?
PostgreSQL users peer authentication on unix sockets by default, where the unix user must be the same as the PostgreSQL user. So people frequently use su or sudo to become the postgres superuser.
Login and Connect as Default User For most systems, the default Postgres user is postgres and a password is not required for authentication.
sudo -u postgres psql postgres # \password postgres Enter new password: To explain it a little bit... By all means read the linked answer, sudo passwd postgres should not be used, instead run sudo -u postgres psql postgres and enter \password postgres .
try this:
$ sudo su postgres
And specify your own password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With