While working with large data in Python and exporting it to MySQL following error occurs:
OperationalError: 2055: Lost connection to MySQL server at 'localhost:3306', system error: 10053 An established connection was aborted by the software in your host machine
The error is most likely because your packet of data is larger then default MySQL packet size. Default packet size is 1,048,576 (1MB). You can check this with following query:
show variables like 'max_allowed_packet'
To remove this error increase maximal packet size in MySQL (ie. to 64 MB) with following query:
set global max_allowed_packet=67108864