Python MySQL connection randomly lost
I have the following problem:
I am using Python with MySQLdb and a SSDictCursor to iterate over a pretty
large database (250M lines). Because I am unable to load everything into
RAM, I am using the streaming API. On the MySQL server, the
max_allowed_packet size is already set to 512M.
I ran my script from different computers (also from the server machine
itself) and it keeps crashing at random times after a random number of
processed rows with the following error:
_mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL
server during query')
Exception _mysql_exceptions.OperationalError: (2013, 'Lost connection to
MySQL server during query') in <bound method SSDictCursor.__del__ of
<MySQLdb.cursors.SSDictCursor object at 0x7fa360e1a690>> ignored
I'm not using threads or anything fancy. I'm totally at a loss why this
happens. Has anyone any idea how to solve this otherwise?
No comments:
Post a Comment