MySQL Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b'\xff\。。。。。。
以上提醒的其实是语法错误,平时我用的插入数据的格式是:
cursor.execute("insert into initlogin(userId,deviceId,pictureFeature,userPass) value('%s','%s','%s','%s')" % ('1031','110','1250146201456','000000'))
但是如果有个字段是blob格式时,使用上述格式是会出现开头我说的错误的,
当有字段是blob,二进制数据插入时,使用以下格式的语句就不会有错误了:
cursor.execute('insert into persons_to_updated(ZJ,operationType,facePicture,operationTime) value(%s,%s,%s,%s)',(['1040','new_ad',MySQLdb.Binary(img),dt]))