본문 바로가기
파이썬

파이썬 Postgres의 URI에 연결

by º기록 2021. 1. 23.
반응형

나는 이것이 매우 기본적인 질문이라고 생각하지만 이유를 알 수 없습니다.

import psycopg2
psycopg2.connect("postgresql://postgres:postgres@localhost/postgres")

다음과 같은 오류가 발생합니다.

psycopg2.OperationalError: missing "=" after
"postgresql://postgres:postgres@localhost/postgres" in connection info string


psycopg2.connect("host=localhost user=postgres password=postgres dbname=postgres")

Ubuntu12.04의 Python2.7.3에서 최신 psycopg2 버전을 사용하고 있습니다.

 

해결 방법

 


 

참조 페이지 https://stackoverflow.com/questions/15634092

 

 

반응형

댓글