python 连接mysql,增删查改
python 连接mysql
import pymysql
# 连接数据库
connect = pymysql.Connect(
host='localhost',
port=3310,
user='woider',
passwd='3243',
db='python',
charset='utf8'
)
# 获取游标
cursor = connect.cursor()
# 插入数据
sql = "INSERT INTO trade (name, acc
转载
2021-07-05 20:11:36 ·
98 阅读 ·
0 评论