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