Increasing 'max_allowed_packet'


I am getting this error on one of my scripts:

Could not Insert to CB_MAIN (update)Got a packet bigger than ‘max_allowed_packet’ bytes

I guess that I need to increase the ‘max_allowed_packet’ byte value in MySQL

With VirtualMin there is the option to change “MySQL System Variables”

In there I find that ‘max_allowed_packet’ is set to : 1048576

What is a reasonable figure to increase it to ?

Also why ıs it 1048576 and not 1,000,000 ?

I am going to double the number up to 2,097,152
and see what happens !

Is there any other variable that should also be adjusted ?


Anyone have knowledge on this ?



I’m unfortunately not familiar with that setting – however, there’s a page over at that describes the problem you’re running into as well as the details of changing that parameter here:

Related post at

You can edit the setting like this:
Webmin > Servers > MySQL Database Server > MySQL Server Configuration,

Change the value in “Maximum packet size” box,

Click “Save and Restart My SQL”.

1 Like