1

I have a very strange case in mysql 5.5.46. the max_allowed_packet keeps resetting to 1024

show variables like 'max_allowed_packet';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_allowed_packet | 1024  |
+--------------------+-------+

although it is set in my.cnf to 32M

[mysqld]
max_allowed_packet=32M

and even if i try to run set global max_allowed_packet=33554432; it shows success but does nothing

mysql> set global max_allowed_packet=33554432;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'max_allowed_packet';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_allowed_packet | 1024  |
+--------------------+-------+
1 row in set (0.00 sec)

when i restart mysql it becomes 32M for a day or two then it back to 1024!! what could be the reason?

1

Sounds like some code somewhere is performing SET @@max_allowed_packet=1024;.

You could turn on the "general log" to find out where it is coming from.

  • i dont think so, max_allowed_packet is readonly variable, and even if i try to set global,,, the value is not affected! – Alaa Sep 5 '16 at 7:03
  • You can set it for the current connection. If not; let's see the statements that you executed. It can be set globally, but only for new connections. – Rick James Jul 3 '17 at 4:14
1

In addition to @Rick James's comment, do note that max_allowed_packet is both a general and a session variable. This is why your queries:

mysql> set global max_allowed_packet=33554432;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'max_allowed_packet';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_allowed_packet | 1024  |
+--------------------+-------+
1 row in set (0.00 sec)

look inconsistent. You set the global value but then read the session value. Try show global variables or set session max_allowed_packet=? to get consistent read/write values.

0

Could it be that you are affected by the zero day recently disclosed?

http://www.zdnet.com/article/zero-day-vulnerability-found-within-mysql-database-application/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.