본문 바로가기
DB/Postgresql

[Postgresql] Peer authentication failed for user "postgres" Error

by JeeU147 2024. 6. 11.
반응형

안녕하세요.

 

오늘은 Peer authentication failed for user "postgres" Error 에 대해서 알아보려고 합니다.

 

 

에러

postgres를 접속하려 하자 아래의 그림 처럼 Peer authentication failed for user "postgres" 에러가 뜨는걸 확인하실 수 있습니다.

psql -U postgres

 

 

 

해결 방법

아래의 pg_hba.conf 설정 파일을 아래와 같이 수정해주셔야 합니다.

 

1. pg_hba.conf 열기

sudo vi /var/lib/pgsql/data/pg_hba.conf

 

 

2. peer -> md5 로 수정하여 저장

 

 

3. postgresql 재기동

sudo systemctl reload postgresql

 

4. psql로 접속

psql -U postgres

 

이것으로 Peer authentication failed for user "postgres" Error에 대해서 알아보았습니다.

 

감사합니다.

반응형

'DB > Postgresql' 카테고리의 다른 글

[Postgresql] postgresql 설치 및 연결  (1) 2024.05.04

댓글