0

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

1 Answers1

0

The error will most likely come back again when you restart MySQL server as value of 'max allowed packets' resets to default (1MB) with every restart. To permanently fix the error you need to change configuration file which has been described here: How to change max_allowed_packet size

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Albert Logic Einstein Sep 14 '22 at 16:42