首先得安装pymysql模块 pip install pymysql 1.连接数据库示例 import pymysql #连接数据库 pymysql.connect("数据库地址","用户名","密码","数据库名") db=pymysql.connect("localhost","root","root","test") #使用cursor()方法创建一个游标对象 cursor=db.cursor() #使用execute()方法执...