Closed tetsaicn closed 7 years ago
你好,希望你把错误提示的上下文再多拿出来一些,这样似乎看不到错误原因
/usr/lib/python2.7/dist-packages/MySQLdb/connections.py:202:unicode_literal
] when dealing with item: {'author': u'\u98ce\u9761\u4e49\u78ca',
'comment_num': 3,
'content': u'http://www.bilibili.com/video/av7630706/',
'floor': 8,
'id': 101635057549L,
'thread_id': 4880973048L,
'time': u'2016-12-21 19:36'}
2017-03-16 19:47:41 [tieba] ERROR: Insert to database error: [Failure instance: Traceback: <type 'exceptions.LookupError'>: unknown encoding: utf8mb4
/usr/lib/python2.7/threading.py:810:bootstrap_inner
/usr/lib/python2.7/threading.py:763:run
/usr/local/lib/python2.7/dist-packages/twisted/_threads/_threadworker.py:46:work
/usr/local/lib/python2.7/dist-packages/twisted/_threads/_team.py:190:doWork
---
你好,请确认你的mysql版本在5.5.3及以上,python的依赖MySQL-python已经是最新版。
Server version: 5.5.53-0+deb8u1 (Debian)
无法更新python-mysql啊啊啊啊
抱歉,我真不知道为什么会无法识别utf8mb4,我这边是完全运作良好的
pip show MySQL-python 看下版本
已经最新版本,然后
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
成功了,谢谢!!
--- ---
/usr/local/lib/python2.7/dist-packages/twisted/python/threadpool.py:246:inContext
/usr/local/lib/python2.7/dist-packages/twisted/python/threadpool.py:262:
/usr/local/lib/python2.7/dist-packages/twisted/python/context.py:118:callWithContext
/usr/local/lib/python2.7/dist-packages/twisted/python/context.py:81:callWithContext
/usr/local/lib/python2.7/dist-packages/twisted/enterprise/adbapi.py:477:_runInteraction
/usr/local/lib/python2.7/dist-packages/twisted/enterprise/adbapi.py:467:_runInteraction
/home/yangyilang/Tieba_Spider/tieba/pipelines.py:64:insert_thread
/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py:159:execute
/usr/lib/python2.7/dist-packages/MySQLdb/connections.py:264:literal
/usr/lib/python2.7/dist-packages/MySQLdb/connections.py:202:unicode_literal
] when dealing with item: {'author': u'LoserPanshao',
'good': False,
'id': 5009721898L,
'reply_num': 2,
'title': u'\u5982\u679c\u4e16\u754c\u6f06\u9ed1\u5176\u5b9e\u4f60\u5f88\u7f8e'}