HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMajor

max_allowed_packet in mySQL

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
mysqlmax_allowed_packetstackoverflow

Problem

I tried all three method explained here to max_allowed_packet. But no one changes its value in my MySQL 5.6.

I use show variables like '%max_allowed_packet%' to see its current value. But it always is 12582912.

Only changing its value in my.ini is effective.

What is wrong?

Solution

You have two values of max_allowed_packet in MySQL :

  • one on the client side : [mysql] section, [mysqldump], [client] and more.



  • one on the server side : [mysqld] section.



The value of max_allowed_packet you see with the command show variables like 'max_allowed_packet'; is the one on the server side.

In order to increase this value, you must increase both sides : in your server configuration file ([mysqld] section in your my.ini file) and in your client configuration file (whether your [client] or [mysql] section in your my.ini file).

This setting can be changed on the server side without restarting the server if you have the SUPER privilege with this command : mysql> SET GLOBAL max_allowed_packet = numeric;.

Don't forget to change the 'numeric' value by a numeric value. Don't forget to change your configuration file too otherwise this value will be reset at reboot.

Context

StackExchange Database Administrators Q#45087, answer score: 21

Revisions (0)

No revisions yet.