Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

su postgres: Sorry? [closed]

Tags:

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?

like image 924
matt Avatar asked Oct 14 '11 08:10

matt


People also ask

What is Su postgres?

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.

What is the default postgres password?

Login and Connect as Default User For most systems, the default Postgres user is postgres and a password is not required for authentication.

What is sudo password for postgres?

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 .


1 Answers

try this:

$ sudo su postgres 

And specify your own password.

like image 178
jishi Avatar answered Sep 22 '22 09:09

jishi