import MySQLdb
con=MySQLdb.connect(host="localhost",user="root",passwd="",db="test",port=3306)
cur=con.cursor()
sql="update user set password='' where name='' "
try:
cur.execute(sql)
con.commit()
except:
con.rollback()
cur.close()
con.close()
Python操作MySQL
最新推荐文章于 2024-09-06 07:22:03 发布