ubuntu – Postgresql: password authentication failed for user “postgres” – Stack Overflow

ubuntu – Postgresql: password authentication failed for user “postgres” – Stack Overflow

If I remember correctly the user postgres has no DB password set on Ubuntu by default. That means, that you can login to that account only by using the postgres OS user account.Assuming, that you have root access on the box you can do:sudo -u postgres psqlIf that fails with a database “postgres” does not exists error, then you are most likely not on a Ubunutu or Debian server :- In this case simply add template1 to the command:sudo -u postgres psql template1If any of those commands fail with an error psql: FATAL: password authentication failed for user “postgres” then check the file /etc/postgresql/8.4/main/pg_hba.conf: There must be a line like this as the first non-comment line:local all postgres identFor newer versions of PostgreSQL ident actually might be peer. That’s OK also.Inside the psql shell you can give the DB user postgres a password:ALTER USER postgres PASSWORD ‘newPassword’;You can leave the psql shell by typing CtrlD or with the command \q.Now you should be able to give pgAdmin a valid password for the DB superuser and it will be happy too. :-share|improve this answer

via ubuntu – Postgresql: password authentication failed for user “postgres” – Stack Overflow.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s