티스토리 뷰

반응형

[Database(데이터베이스)/postgreSQL] 외부 허용하기 / 외부에서 DB 접근 가능하게하기

기본적으로 postgreSQL는 localhost 수준에서 DB접근을 허용한다.

때문에 외부에서 접근을 하기위해서는 config파일을 수정해줘야한다.

pg_hba.conf 파일이 그 역할을 한다.

 

[위치]

C:\Program Files\PostgreSQL\(버전번호)\data\pg_hba.conf 

C:\Program Files\PostgreSQL\14\data\pg_hba.conf  - 14버전일경우

C:\Program Files\PostgreSQL\12\data\pg_hba.conf  - 12버전일경우

 

기본위치는 그렇하고, 버전마다 data경로의 앞이 바뀔 수 있다.

[변경할 내용]

그림과 같이

host    all             all             0.0.0.0/0            scram-sha-256

다음과 같은 내용을 추가해주면 외부접속이 허용된다.

 

#postgresql #postgres #sql #외부허용 #pg_hba.conf  # SSL off error #error #postgres window #postgres error

반응형
댓글
반응형