[PostgreSQL] localhost 말고 ip로 접속 하는데 안될 때 해결 방법
2024.01.02 - [Database/PostgreSQL] - [PostgreSQL] windows에 포스트그레스큐엘 설치하기
[PostgreSQL] windows에 포스트그레스큐엘 설치하기
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads Community DL Page Note: EDB no longer provides Linux installers for PostgreSQL 11 and later versions, and users are encouraged to use the platform-native packages. Version 10.x and below
pkguma.tistory.com
postgresql을 위 글대로 설치했다.
(현재 내 postgresql 버전은 15 이다)
그리고 localhost로는 접속 성공하는것을 확인함.
그리고 127.0.0.1로도 접속 성공함
근데 내 외부 아이피인 192.168.0.8 로는 접속실패
에러내용 ;
ġ��������: ȣ��Ʈ "192.168.0.8", ����� "postgres", �����ͺ��̽� "postgres", ��ȣȭ ���� ���ῡ ���� ������ pg_hba.conf ���Ͽ� �����ϴ�.
이럴때 해결방법은 ?
위에 깨진 내용속에 보이는 pg_hba.conf 를 찾아간다.
위 파일은 설치파일 위치 경로 가 아래와 같다.
C:\Program Files\PostgreSQL\15\data
만약 다른곳에 설치했다면 그 위치에서 찾으면 된다.
저 폴더 내에 pg_hba.conf 파일을 열어서 87번째 줄인
host all all 127.0.0.1/32 scram-sha-256
이부분의 아이피를 0.0.0.0/0 으로 수정한다.
host all all 0.0.0.0/0 scram-sha-256
그리고 저장한다.
그리고 다시 테스트해보면
성공~