9

I've never really had this error before but I am doing a rather large insert. How do I increase this setting? Also, how do I tell how much I am over what's allowed? I tried looking up the error, but i'm not using Fogbugz. Any help would be awesome.

This is a windows installation of mysql.

3 Answers 3

15

To set the max to 16MB for example, without requiring a restart, run:

SET GLOBAL max_allowed_packet = 16777216
Sign up to request clarification or add additional context in comments.

Comments

13

How to fix this problem : change the value of the max_allowed_packet variable in the configuration of your MySQL server.

How to know how much over what's allowed you are : not sure, but I would say that checking the size (in bytes) or your insert query should give you an idea.


For more informations, you should take a look at the following section of the MySQL manual : C.5.2.10. Packet too large.

4 Comments

whats the command for it, i try max_allowed_packet=4m or --max_allowed_packet=4m and it says I have an error.
The best solution is to set this variable in the my.cnf file of your server -- this way, it'll be taken into account each time your server starts.
well i guess i have a dumb question, where the heck is the my.cnf file or do i create it? i've searched my entire server and cant find it
I don't really know where this file is on windows, sorry (I usually work with Linux servers) ; judging from dev.mysql.com/doc/refman/5.1/en/windows-create-option-file.html you might have to create it ?
2

I faced a similar issue while using XAMPP and what I did was to open the my.ini file via the Config button of MySQL on the XAMPP control and changing max_allowed_packet from 1M to 100M. It solved my problem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.