No gossip, just go straight to the operation!
1. Preparation
1. Install MySQL and Python locally (take 3.6 as an example)
2. MySQL creates a new database [test], a new table [user], and a new field [name] [age]
3. Create a table method: navicat tool
field
Two, Python operation - insert data
#!/usr/bin/env
# coding=utf-8
import pymysql
# Python 连接MySQL-本地测试
def main():
# 1.设置连接
db