학원/Python

MySQL 연결

TaemTaem 2020. 5. 28. 11:37

[ 목차 ]

1. My SQL 설치

2. 파이참에서 PyMySQL 모듈 설치

3. 연결

4. 쿼리 실행

5. 종료

6. select와 insert

 

1. My SQL 설치

https://www.mysql.com/downloads/

 

MySQL :: MySQL Downloads

Contact MySQL  |  Login  |  Register The world's most popular open source database MySQL.com Downloads Documentation Developer Zone MySQL Enterprise Edition includes the most comprehensive set of advanced features and management tools for MySQL. MySQL

www.mysql.com

 

2. 파이참에서 PyMySQL 모듈 설치

1) 터미널 실행

2) pip PyMySQL 입력

3) 터미널에 pip list 입력하여 설치 확인, 또는 settings에서 확인 가능

 

3. 연결

1) import 후 db연결하기

 

4. 쿼리 실행

 

5. 종료

 

6. select와 insert