python插入mysql新值

#Server Connection to MySQL:

import MySQLdb
conn = MySQLdb.connect(host= "localhost",
user="root",
passwd="newpassword",
db="engy1")
x = conn.cursor() try:
x.execute("""INSERT INTO anooog1 VALUES (%s,%s)""",(188,90))
conn.commit()
except:
conn.rollback() conn.close()
上一篇:windows下 安装Kali Linux到 U盘的方法


下一篇:hashMap原理(java8)