Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  Web Hosting FAQ  >  Got a packet bigger than ‘max_allowed_packet’ bytes
Top Scroll

Got a packet bigger than ‘max_allowed_packet’ bytes

 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.

max_allowed_packet=16M

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.

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.