Postgres (SQL) - Resolve "Peer authentication failed for user"
by
Jeremy Canfield |
Updated: August 28 2023
| Postgres (SQL) articles
Let's say something like this is being returned.
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "johndoe"
In this example, the error is occur with user account johndoe. This assumes you have:
- created user account johndoe - Postgres (SQL) Create user
- given johndoe a password - Reset a users password
- granted johndoe the appropriate roles
- updated pg_hba.conf with MD5 for johndoe
Did you find this article helpful?
If so, consider buying me a coffee over at