Knowledge Base
MilesWeb / Web Hosting FAQ

Got a packet bigger than ‘max_allowed_packet’ bytes

Approx. read time : 2 min

A communication packet is a single SQL statement sent to the MySQL server. The largest packet that can be be sent to Mysql server is 1GB. When the mysql server receives a packet bigger than the max allowed one it shows an error as below.

MySQL said: Documentation
#1153 – Got a packet bigger than ‘max_allowed_packet’ bytes

At times you might loose connectivity with mysql server if the packet is too large. Both client & server has a threshold of max packet size, so if you want to handle big packets, you must increase the variable limits on the server.

Open the file below on your server. You cannot increase the limits on shared hosting OR reseller hosting plans.

# vi /etc/my.cnf

You can increase the limit as per your requirement. Now we will set it to 16MB. Below is what you need to add in the mysql config file.


Save the file & exit. Restart mysql.

You can check the increased limit with command.

# mysqladmin variables | grep max_allowed_packet

You can configure custom mysql variables as required with our VPS hosting & dedicated server plans.

With over 10+ years of experience in the web hosting industry, I have achieved extensive exposure to result-oriented methodologies. And expertise in different domains like Datacentre Services, Cloud computing technology, Web hosting industry and many more.