The server did not return a non-zero value for the max_allowed_packet variable

Sandi's profile image Sandi posted 5 years ago in General Permalink

After trying v10.2.0.5763 (copy heidisql.exe to portable folder), log box start showing this log:

/* The server did not return a non-zero value for the max_allowed_packet variable. Assuming 1,0 MiB now. *

new log every 1-2 minutes.

(v10.2.0.5599 didn't has this log)

On Github code:


if Result < SIZE_MB then begin

Result := SIZE_MB;

Log(lcError, f_('The server did not return a non-zero value for the %s variable. Assuming %s now.', ['max_allowed_packet', FormatByteNumber(Result)]));

end;


  1. Can you tell me what is SIZE_MB?

  2. And do i need to to something?

ansgar's profile image ansgar posted 5 years ago Permalink

SIZE_MB is 1MB.

No, you don't need to do anything. It just says that HeidiSQL is unsure about what your server allows as the biggest size for a query packet, e.g. when you export a database into another database. You can check yourself what the server allows:

SHOW VARIABLES LIKE 'max_allowed_packet';
Sandi's profile image Sandi posted 5 years ago Permalink

SHOW VARIABLES LIKE 'max_allowed_packet'; RESULT = 1047552 (on my server)

1MB = 1048576

If 1047552 < 1048576 so the log written


From the Github Code:

If the server max_allowed_packet below 1048756 (1MB), then HeidiSQL assuming it's 1048576 (1MB)?


  1. So, if one day when I use some HeidiSQL features that send big packet (HeidiSQL send the assuming 1,0MiB / 1048576 packet to server), the packet would be rejected because exceed max allowed value (1047552) right?

  2. Why HeidiSQL need to assume (it's 1048756) when it can read the real max_allowed_packet value is 1047552? :D

ansgar's profile image ansgar posted 5 years ago Permalink

Good question. Less than 1M should actually be ok, as long as it's over let's say 10KB.

Code modification/commit 097a902 from Ansgar Becker <anse@heidisql.com>, 5 years ago, revision 10.2.0.5766
Support very low max_allowed_packet setting in TMySQLConnection.MaxAllowedPacket, so it has to be >10K only, for not assuming 1M for SQL exports. See https://www.heidisql.com/forum.php?t=35046
Sandi's profile image Sandi posted 5 years ago Permalink

Ok thanks, using 10.2.0.5766 now :)

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