Peer authentication failed for user with all privileges in Postgres 9.5
-
Open
/etc/postgresql/9.5/main/pg_hba.conf
with root accesssudo nano /etc/postgresql/9.5/main/pg_hba.conf
-
Change
peer
tomd5
in these lines.Before changing
# "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 peer # IPv6 local connections: host all all ::1/128 peer
After your change
# "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5
Save the file with pressing Ctrl-O. Exit nano with Ctrl-X
-
Restart postgresql using
sudo service postgresql restart