Skip to content
ohsudo, Home

Tags

#psql

Peer authentication failed
Databases

PostgreSQL "Peer authentication failed for user": connect the right way, or change pg_hba.conf

Fix PostgreSQL "Peer authentication failed for user": use sudo -u postgres, connect over TCP with -h localhost, or change pg_hba.conf to scram-sha-256 and reload.

Beginner · 4 min read