import pymysql # 打开数据库连接 connection = pymysql.connect(host='127.0.0.1', user='root', passwd=', db='student', # 数据库名 port=3306, charset='utf8' ) try: # 使用cursor()方法获取操作游标 # cur = connection.cursor() # 获取到的结果是元组 cur = connection.cursor(pymysql.cursors.…