Introduction
There are numerous instances when MySQL will require a higher max_allowed_packet value for the desired function to complete properly.
Procedure
This variable's value can be increased at the main MySQL configuration file located at /etc/my.cnf. This particular variable can be added under both the [mysqld] and [mysqldump] section within the configuration file. Typically unless you are trying to specifically change the value when using the mysqldump command, you will want to update the variable under [mysqld] to whatever value meets your needs. It will look like the following by default:
max_allowed_packet=268435456
Once changed you will need to restart MySQL for the changes to take affect:
/scripts/restartsrv_mysql
Please also be aware of the following minimum/maximum values for max_allowed_packet on MySQL/MariaDB:
Minimum Value | 1024 |
---|---|
Maximum Value | 1073741824 |
More information on this value can be found at:
https://dev.mysql.com/doc/refman/8.0/en/replication-features-max-allowed-packet.html
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_allowed_packet
https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet