업무/sys

Centos 7 postgresql 접속 오류시 조치 방법

sysops 2018. 7. 8. 01:05
728x90


처음 postgresql 구성간 아래와 같은 에러 메세지가 나올 경우

....

psycopg2.OperationalError: FATAL:  Ident authentication failed for user "test"

....


psql: FATAL:  Peer authentication failed for user "test"




[root] # vi /var/lib/pgsql/10/data/pg_hba.conf 

위 경로 들어가 상황에 맞게 METHOD 부분의 ident를  MD5 or trust로 변경해 준다.


# IPv4 local connections:

host    all             all             127.0.0.1/32            md5


[root] # systemctl restart postgresql-10


접속 성공~

728x90