Skip to content
ohsudo, Home

Tags

#pg-hba

no pg_hba.conf entry
Databases

PostgreSQL "no pg_hba.conf entry for host": allow this connection, the safe way

Fix PostgreSQL "FATAL: no pg_hba.conf entry for host": read the host, user and SSL in the message, add a narrow rule to pg_hba.conf, reload it, and handle Docker and SSL.

Intermediate · 4 min read

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