PostgreSQL: MD5 Authentication in pg_hba.conf gives me FATAL: Peer authentication failed for user "postgres" -


i'm running ubuntu 14.04 , installed postgresql 9.3. edited /etc/postgresql/9.3/main/pg_hba.conf as:

# "local" unix domain socket connections local                                                   md5 # ipv4 local connections: host                            127.0.0.1/32            md5 # ipv6 local connections: host                            ::1/128                 md5 

i restarted server , i'd login postgres postgres:

victor@workstation:~$ psql -u postgres psql: fatal:  peer authentication failed user "postgres" 

shouldn't postgres prompt password, i've set authentication method md5 ?

i understand if add -h localhost work.

does not adding flag causes psql use peer-authentication?

you must have local ... peer line above those. error peer authentication failed comes server, , it's server tha picks auth method.

other possibilities be:

  • didn't restart server
  • edited wrong pg_hba.conf file if there multiple postgresql instances on system.

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -