본문 바로가기
IT/Tip

postgreSQL 외부접속 가능하게 하기

by 여우요원 2019. 3. 21.
반응형



postgreSQL에서 외부접속 가능하게 하기 (macOS, homebrew)


아래의 설정 파일 2개를 수정해야 하는데 macOS에 homebrew로 postgreSQL을 설치 한 경우 그 위치는 이렇다.


/usr/local/var/postgres


 - pg_hba.conf

 - postresql.conf 



1. 먼저 postgresql.conf 파일을 열어서 listen_addresses 부분을 그림과 같이 '*'로 수정한 후에 저장한다.

2. 다음 pg_hba.conf 파일을 열어서 그림의 빨간색 부분을 추가한다. 

host    all    all    0.0.0.0/0    password


3. 마지막으로 postgreSQL  서비스를 재시동 한다.


 $ brew services stop postgresql


 $ brew services start postgresql



반응형