如果你是通过终端、cmd `set global max_allowed_packet = xxx`,设置的话,重启mysql服务就会失效的,去my.ini/my.cnf修改参数 `max_allowed_packet=20M`,这样就是一直生效的。