project
지도 데이터 교체 및 gis database에 로드 시 오류 발생 해결 과정
신규_유저
2023. 5. 23. 17:27
<1차 시도>
ERROR: Connecting to database failed: connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no password supplied
password가 필요한데, 주지 않으면 발생하는 에러임.
pgsql\data\pg_hba.conf 파일 내용 수정
DB 내 supger user인 상태로 설정 reload 실행
select pg_reload_conf();
이렇게 했는데 안 될 경우 DB 종료 및 재실행
지도 데이터 교체 및 gis database에 로드 시도
<2차 시도>
공식문서 내용 확인 후 pg_hba.conf 재수정


DB 종료
exit
재접속
Psql -U postgres
DB 내 supger user인 상태로 설정 reload 실행
select pg_reload_conf();
지도 데이터 교체 및 gis database에 로드 시도
<3차 시도>
DB 내 superuser 상태로 아래 명령어 입력
/PostgreSQL/osm/osm2pgsql-bin/osm2pgsql --slim -d gis --hstore --multi-geometry --number-processes 1 --tag-transform-script D:\PostgreSQL/osm/openstreetmap-carto/openstreetmap-carto.lua --style D:\PostgreSQL/osm/openstreetmap-carto/openstreetmap-carto.style -C 1600 D:\PostgreSQL/osm/south-korea-latest.osm.pbf
이것 또한 실패함.
<4차 시도>
DB 처음부터 재설치(Binaray file 받아서 진행했기에 편했음)
osm2pgsql 환경 변수 등록
- 시스템 속성의 환경 변수 버튼 클릭
- 시스템 변수의 path 선택 후 편집 클릭
- 환경 변수 편집 창 상단의 새로 만들기 클릭
- osm2pgsql.exe 파일이 있는 폴더 경로 입력 후 확인 버튼 클릭
Powershell 두 개 열어둔 상태로
한 곳은 DB 실행,
.\psql -U postgres
한 곳은 명령어 입력
osm2pgsql -s -d gis -U osm --hstore --multi-geometry --number-processes 1 --style D:\PostgreSQL\osm\openstreetmap-carto\openstreetmap-carto.style -C 1600 D:\south-korea-latest.osm.pbf