#!/usr/bin/env python3 #-*- coding:utf-8 -*- ''' Administrator 2018/10/9 ''' import pymysql # 创建连接 conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='ss@123', db='sqlexample',charset='utf8') # 创建游标 cursor = conn.cursor() # cursor.execute("insert into class (caption) VALUES ('中午补习班')") cursor.execute("delete from class where caption='中午补习班'") # r=cursor.execute("select * from class") # print(r)