2 yangchao228 yangchao228 于 2014.05.11 17:22 提问

python 中文插入mysql报错

哪位大神帮忙看看这个是什么问题? python 中文插入mysql报错:
content= [1165630L, '13940546367', 361L, None, Decimal('449.00'), Decimal('0.00'), '\xd5\xd4\xd4\xa8\xd5\', '\xc1\xc9\xc4\xfe\xca\xa1', '\xc9\xf2\xd1\xf4\xca\xd0', '\xba\xcd\xc6\xbd\xc7\xf8', '\xb6\xfe\xbb\xb7\xd2\xd4\xc4\xda', '\xb1\xb1\xc6\xdf\xc2\xed\xc2\xb714-1\xb3\xc7\xca\xd0\xbc\xd2\xd4\xb02-231' , 0, None, None, None, 'cancel', None, None, datetime.datetime(2014, 4, 21, 16, 50, 18), datetime.datetime(2014, 4, 22, 16, 50, 18), '210102', 1L, '59.46.115.218', 0, '5354dbc27a36b', None, 'pc', '1039175060', None, None, 0, 'midpage', None, None, '', 'BAIDUID=4BFEB25D0B44FB29C713EB0A281070EC%3AFG%3D1;PHPSESSID=g54k04ub8bj4etpdgkf0ne22n6;fr=ps-zhixin-weigou-b;psid=1465;frq=%E7%A2%A7%E6%AC%A7%E6%B3%89+%E7%94%B7%E5%A3%AB;qid=f31f0fd9000b8c54;', '4BFEB25D0B44FB29C713EB0A281070EC%3AFG%3D1', 'g54k04ub8bj4etpdgkf0ne22n6', 'ps-zhixin-weigou-b', '%E7%A2%A7%E6%AC%A7%E6%B3%89+%E7%94%B7%E5%A3%AB', 'f31f0fd9000b8c54', '1465'] len= 43

(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 '\xc1\xc9\xc4\xfe\xca\xa1','\xc9\xf2\xd1\xf4\xca\xd0','\xba\xcd\xc6\xbd\xc7\xf8','\xb6\xfe\xbb\xb7\xd2\xd4\xc4\xda','\xb1\xb1\xc6\xdf\xc2\xed\xc2\xb714-1\xb3\xc7\xca\xd0\xbc\xd2\xd4\xb02' at line 1")

1个回答

oyljerry
oyljerry   Ds   Rxr 2014.12.26 21:18

sql语法有问题,是不是转移字符的问题

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!