0

I'm trying to import a very large database (file of 14go) on a local MySQL intall. But after few seconds of importation, I get this error message : ERROR 2013 (HY000) at line 592: Lost connection to MySQL server during query

How could I get rid of it and import all my file ?

The .sql file create a table and insert a lot of data in it, especialy the content of .pdf files. exemple :

INSERT INTO `pj_test` VALUES (12213,'test.pdf',246584,_binary '%PDF-1.3\r1 0 obj\r<</Type[...]');

The line 592, where I alway get the error, is 4 887 411 characters long. The queries before are shorters (the INSERT INTO ones are around 1 000 000 characters long).

What I tried to solve this :

On workbench, I setup some parameters : on Edit>Preferences>SQL Editor I set the DBMS connection keep-alive interval at 0, the DBMS connection read timeout interval at 0 and the DBMS connection timeout interval at 0.

I also tried to use the Windows console to import, with the options sql --connect-timeout=3600 and --max-allowed-packet=16M

I also tried to edit the .sql file by adding these lines :

SET GLOBAL net_read_timeout=3600;
SET GLOBAL MAX_EXECUTION_TIME = 3600000;
SET GLOBAL interactive_timeout=3600;

Each time, I recive the same 2013 error, after few seconds.

  • 1
    max_packet_size? – Akina Feb 15 '22 at 12:37
  • It's not the number of characters that count, but the byte size of the sql statement as a character may be encoded into multiple bytes. I agree with @Akina, this is an issue with max_packet_size – Shadow Feb 15 '22 at 12:42

0 Answers0