[mac] postgresql 외부접속 가능하게 변경

DB/Postgresql|2021. 8. 15. 11:31

[mac] postgresql 외부접속 가능하게 변경

 

설정파일이 있는 디렉토리로 이동합니다.

cd /usr/local/var/postgres

 

vi editor로 설정파일을 오픈합니다.

vi postgresql.conf

 

listen_addresses = '*' 외부에서 접속 가능하도록 설정을 변경합니다.

... 중략 ...
# - Connection Settings -

listen_addresses = '*'          # what IP address(es) to listen on;
... 중략 ...

 

ssl off 설정을 추가합니다.

vi pg_hba.conf

가장 마지막 줄에 아래 내용을 입력합니다.

host  all  all 0.0.0.0/0 md5
위와 같이 설정하지 않으면 아래와 유사한 오류가 발생합니다.
 [1342] FATAL:  no pg_hba.conf entry for host "x.x.x.x", user "aptdb", database "postgres", SSL off

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

Postgresql rownum 사용하기  (0) 2021.08.16
PostgreSQL Drop column  (0) 2021.08.15
[mac] postgresql 서비스 시작/종료  (0) 2021.08.15
windows 에 PostgreSQL 설치  (0) 2021.08.05
PostgreSQL 테이블 생성  (0) 2021.08.04

댓글()