我的爬虫程序使用了DBUtils建立了数据库连接池,目前在windows上运行没有问题,但在centos上运行会出现如下报错,困扰了两天了,特发此贴请教下各位大佬,感激不尽
Process Process-4:
Traceback (most recent call last):
File "/usr/lib64/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib64/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/wwwroot/TikTokSpider/spider/main_spider.py", line 358, in run_spider
user_spider(sec_uid)
File "/home/wwwroot/TikTokSpider/spider/main_spider.py", line 54, in user_spider
user_handler(user, db)
File "/home/wwwroot/TikTokSpider/public/common.py", line 853, in user_handler
db.insert(insert_user, nickname)
File "/home/wwwroot/TikTokSpider/public/db_con.py", line 88, in insert
return self.__edit(sql, log)
File "/home/wwwroot/TikTokSpider/public/db_con.py", line 102, in __edit
self.db.begin()
File "/pyenvs/spider/lib64/python3.6/site-packages/DBUtils/SteadyDB.py", line 425, in begin
begin(*args, **kwargs)
File "/pyenvs/spider/lib64/python3.6/site-packages/pymysql/connections.py", line 410, in begin
self._read_ok_packet()
File "/pyenvs/spider/lib64/python3.6/site-packages/pymysql/connections.py", line 396, in _read_ok_packet
raise err.OperationalError(2014, "Command Out of Sync")
pymysql.err.OperationalError: (2014, 'Command Out of Sync')