SQL Error: Lost Connection to MySQL Server during Query

[expired user #1498]'s profile image [expired user #1498] posted 17 years ago in Creating a connection Permalink
What does that mean?
I haven't found another topic with this content. So i hope there isn't anyone...

What can i do now? My .sql file is very big: 20 MB. But i don't want to cut it into many pieces. Please help

Chiko
ansgar's profile image ansgar posted 17 years ago Permalink
I guess you have to increase the server-variable "max_allowed_packet" if you want to import you big bunch of SQL at once. Should be going this way:
SET max_allowed_packet=1073741824

After running this query in your HeidiSQL-query-tab you should be able to import a 1GB INSERT-statement on one go.

Note that it's not the file size which matters. It's a problem of the extended INSERT syntax which can contain a large number of rows. If the these INSERTs are too big, you get normally disconnected with the error you got or with "MySQL server has gone away".

Be aware that the variable is only changed for your current session! If you reconnect the max_allowed_packet is again set to the default value.

Please login to leave a reply, or register at first.