백엔드/Python
[python] python + postgresql 연동하기
작은소행성
2021. 10. 28. 09:15
python 프로그래밍 언어용 postgresql 어댑터를 설치해준다.
pip install psycopg2-binary
postgres와 연결하기 위해서는 psycopg2 패키지의 connect이용하면된다.
import psycopg2
conn = psycopg2.connect(
host = "localhost",
port = 5432,
dbname = "test",
user="root",
password="1234")
반응형