Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- chatgpt vs bard
- 라이브러리 vs 패키지
- robux
- chatgpt 100% 신뢰금지
- 데이터 리터러시
- Google vs OpenAI
- 가장 인기있는 파이썬 라이브러리
- 가장 인기있는 파이썬 패키지
- Python
- 상업시설용지 분양
- 갤럭시탭 with Pen
- 다주택임대
- 임대소득외 추가소득이 있을 경우
- 오피스텔투자
- 전세보증보험
- 소형주택 세액감면
- 종합소득세
- 오라클 데이터베이스 내장함수
- 파이썬 TypeError
- Google vs MicorSoft
- 2룸 오피스텔 투자
- bard 100% 신뢰금지
- 주상복합용지 분양
- 주택임대사업자
- 가장 많이 사용되는 파이썬 패키지
- PostgreSQL
- 공개서적
- 나는 어디로?
- 종합과세
- 가장 많이 사용되는 파이썬 라이브러리
Archives
All thing of the world!
python mysql 데이터베이스 접속 코딩(connection code) 본문
python으로 mysql 데이터베이스에 접속하는 코드(coding)를 정리한다.
1. mysql.connector 설치
pip install mysql.connector
2. connection 코드 작성
import mysql.connector
from mysql.connector import errorcode
try:
cnx = mysql.connector.connect(user='scott', password='password',
host='127.0.0.1',
database='employees')
except mysql.connector.Error as err:
print(err)
else:
cnx.close()
끝.
'IT > python' 카테고리의 다른 글
python mongodb 데이터베이스 접속 코딩(connection code) (0) | 2023.04.29 |
---|---|
python postresql 데이터베이스 접속 코딩(connection code) (0) | 2023.04.29 |
python 데이터베이스 접속(connection code) 정리 (0) | 2023.04.29 |
python Scrapy 초간단 사용법 정리 (2) | 2023.04.29 |
merge 설명 : python pandas 함수 (0) | 2022.03.27 |
Comments