2

I currently have a 9.3 server running (on Ubuntu 14.04) with "trust" set as the authentification method in pg_hba.conf. How can I set the password again. In pgadmin the server currently doesn't allow me to access the console (The PSQL console closes immediately after I open it).

I have the feeling that setting the password using

     $ sudo -u postgres psql

changes the password of a parallel running 9.1 server.

Using

     psql -U postgres

gives an error saying

   psql: FATAL:  Peer-Authentifizierung für Benutzer »postgres« fehlgeschlagen

(peer authentification for user postgres failed)

pg_hba.conf

    # Database administrative login by Unix domain socket
    local   all             postgres                                trust

    # TYPE  DATABASE        USER            ADDRESS                 METHOD

    # "local" is for Unix domain socket connections only
    local   all             all                                     trust
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            md5
    # IPv6 local connections:
    host    all             all             ::1/128                 md5
    # Allow replication connections from localhost, by a user with the
    # replication privilege.
    #local   replication     postgres                                peer
    #host    replication     postgres        127.0.0.1/32            md5
    #host    replication     postgres        ::1/128                 md5

Setting password in pgadmin

After setting the password for the postgres user (1), the ENCRYPTED PASSWORD appears in pgadmin (2), but psql -U postgres still fails.

enter image description here

Previous question:

2
  • @a_horse_with_no_name - pinging May 9, 2014 at 9:45
  • you can't ping a user like that. Aug 4, 2015 at 12:02

1 Answer 1

0

If your pg_hba.conf is set correctly and you're sure about your password, and you're still getting issues related to "peer authentication" failed, you probably need to reload your postgresql instance

/etc/init.d/postgresql reload 9.3 

should reload your settings and allow you to use the password. Hope that helps. =)

Not the answer you're looking for? Browse other questions tagged or ask your own question.