微信登录

第三方库 - 操作MySQL存储 - PyMySQL删表内容

第三方库 - 操作MySQL存储 - PyMySQL删表内容

使用连接数据库 pymysql库 例子 删除指定表

  1. def MysqlDELET(table):
  2. cursor.execute("SET foreign_key_checks=0;")
  3. db.commit()
  4. cursor.execute("truncate table %s;" % table)
  5. db.commit()
  6. cursor.execute("SET foreign_key_checks=1;")
  7. db.commit()
第三方库 - 操作MySQL存储 - PyMySQL删表内容