linux & postgres: FATAL: Peer authentication failed for user

Trabla: FATAL:  Peer authentication failed for user

Example:


pg_dump -U postgres --password  -Fc mydb > /home/user1/mydb.dump

pg_dump: [archiver (db)] connection to database "mydb " failed: FATAL:  Peer authentication failed for user "postgres"


Solving:
Add host:

pg_dump -h 127.0.0.1  -U postgres --password  -Fc mydb > /home/user1/mydb.dump

No comments:

Post a Comment