赞
踩
db = mysql.connector.connect( host = "127.0.0.1", user = "root", passwd = "123456", database="mysql", auth_plugin='mysql_native_password' ) db.start_transaction() cursor = db.cursor();
data = dict() data["student_name"]="zhangsan" cursor.execute("insert into student(student_name) values(%(student_name)s)",data)
no module named mysql.connector no modul named mysql 这个问题 不要文件命名为mysql,下载mysql-connector 这个包就可以解决。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。