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