

And then copy the rows you are able to copy via e.g. First I created a "tmp" table with the schema of the old one. In my case I lost 10 rows of data because i had to skip these corrupted rows. The solution was to copy the data into a new table. Mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table mytable at row: 12723 The nice thing was that MySQL returned me the row number which was the first what failed. The error was not related to any memory issues etc. I was also not able to mysqldump my table because some rows broke it. _mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query')Įxception _mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query') in > ignoredĮRROR 2013 (HY000): Lost connection to MySQL server during queryĮrror was that parts of my table were corrupted. Return self._result.fetch_row(size, self._fetch_type) nn = nnect('hostname', 'user', '*****', 'some_table', cursorclass=)Įxcept (AttributeError, MySQLdb.OperationalError):įile "/usr/lib64/python2.5/site-packages/MySQLdb/cursors.py", line 417, in nextįile "/usr/lib64/python2.5/site-packages/MySQLdb/cursors.py", line 388, in fetchoneįile "/usr/lib64/python2.5/site-packages/MySQLdb/cursors.py", line 285, in _fetch_row This is basically the code I have here: # I'm always getting this Lost connection message and I'm not able to reconnect and restore the cursor to the last position it was.

I have a huge table and I need to process all rows in it.
