V
V
vlarkanov2017-09-19 14:24:06
linux
vlarkanov, 2017-09-19 14:24:06

Why doesn't SET GLOBAL max_allowed_packet work?

Hello. MySQL - Percona 5.7. Now the value of the variable max_allowed_packet = 16M. I need to change its value to 256M without rebooting the server. I do as it is written in the manual https://dev.mysql.com/doc/refman/5.7/en/program-va... :


mysql> SET GLOBAL max_allowed_packet=256*1024*1024;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'max_allowed_packet';
+--------------------+----------+
| variable_name | value |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set (0.01 sec)

Why does not it work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2017-09-19
@Tabletko

try without 'GLOBAL'

V
vlarkanov, 2017-09-20
@vlarkanov

Understood. Not there I checked the value of the variable after it was set. Once we set the GLOBAL variable, then we need to check GLOBAL:
mysql> SHOW GLOBAL VARIABLES LIKE 'max_allowed_packet';
+--------------------+-----------+
| variable_name | value |
+--------------------+-----------+
| max_allowed_packet | 268435456 |
+--------------------+-----------+
1 row in set (0.00 sec)
And if you try to set a variable without GLOBAL, then writes
mysql> SET max_allowed_packet=256*1024*1024;
ERROR 1621 (HY000): SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question