在python中通过mysqldb向mysql服务器插入数据时出错
执行此操作时,MYsqldb返回1L:-在python中通过mysqldb向mysql服务器插入数据时出错,python,sql,mysql-python,Python,Sql,Mysql Python,执行此操作时,MYsqldb返回1L:- db=MySQLdb.connect('localhost','root','12345678','kitkat') cur=db.cursor() cur.execute("INSERT INTO justdial(id,email_raw,status) VALUES (NULL,'none','none')") 如果你没有得到错误 尝试在执行后添加db.commit 我个人更喜欢mysql.connector。返回到哪里?在连接线上?在执行行上?
db=MySQLdb.connect('localhost','root','12345678','kitkat')
cur=db.cursor()
cur.execute("INSERT INTO justdial(id,email_raw,status) VALUES (NULL,'none','none')")
如果你没有得到错误 尝试在执行后添加db.commit
我个人更喜欢mysql.connector。返回到哪里?在连接线上?在执行行上?为什么您认为这是一个错误?因为数据没有被插入到数据库中