import MySQLdb conn = MySQLdb.connect(host=‘172.16.202.182‘,user=‘fengjian‘,passwd=‘123456‘,db=‘fengjian‘) cur = conn.cursor() sql = ‘insert into admin (name,passwd) VALUES(%s,%s)‘ params = (‘feng‘,‘123456‘) recout = cur.execute(sql,params) conn.commit() cur.close() conn.close() print recout
时间: 2024-10-05 05:56:52