I want to change max_allowed_packet at runtime .using sql statement. is there any sql statement to do that.
Asked
Active
Viewed 1,913 times
0
-
Possible duplicate of [How to change max\_allowed\_packet size](http://stackoverflow.com/a/8062996) – eggyal Jan 03 '14 at 10:15
1 Answers
3
max_allowed_packet
is set in mysql config, not on php side
[mysqld]
max_allowed_packet=16M
You can see it's curent value in mysql like this:
SHOW VARIABLES LIKE 'max_allowed_packet'
You can try to change it like this, but it's unlikely this will work on shared hosting:
SET GLOBAL max_allowed_packet=16777216;
You can read about it here http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html
-
To elaborate on "*it's unlikely this will work on shared hosting*", as documented under [Using System Variables](http://dev.mysql.com/doc/en/using-system-variables.html): "**The [`SUPER`](http://dev.mysql.com/doc/en/privileges-provided.html#priv_super) privilege is required to set global variables.**" – eggyal Jan 03 '14 at 10:21