If you set it in the cnf(it may be my.ini file) you will likely need to restart the server. Optionally, that is a dynamic variable and can be SET GLOBAL or SET SESSION from the command line as well.So just do as follows.
mysql>show variables like’max_allowed_packet’;
mysql>set global max_allowed_packet=67108864;
mysql>exit;
Note: If you don't use global or use session,after execute exit command,max_allowed_packet value will be still 1048576.

本文介绍了如何通过修改 MySQL 的 my.ini 文件或者使用 SQL 命令来动态调整 max_allowed_packet 参数的方法,这对于提高服务器性能及解决数据包大小限制问题至关重要。
423

被折叠的 条评论
为什么被折叠?



