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 | 29 | 30 | 31 |
Tags
- 종합과세
- 나는 어디로?
- 가장 많이 사용되는 파이썬 패키지
- 가장 인기있는 파이썬 패키지
- chatgpt vs bard
- 데이터 리터러시
- PostgreSQL
- 오피스텔투자
- robux
- 가장 인기있는 파이썬 라이브러리
- 임대소득외 추가소득이 있을 경우
- 주상복합용지 분양
- Google vs MicorSoft
- bard 100% 신뢰금지
- 상업시설용지 분양
- 종합소득세
- 오라클 데이터베이스 내장함수
- 파이썬 TypeError
- 공개서적
- 가장 많이 사용되는 파이썬 라이브러리
- 라이브러리 vs 패키지
- Google vs OpenAI
- 주택임대사업자
- 다주택임대
- 소형주택 세액감면
- chatgpt 100% 신뢰금지
- 2룸 오피스텔 투자
- Python
- 전세보증보험
- 갤럭시탭 with Pen
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