简介
max_allowed_packet 表示MySQL客户端和服务器之间,单条消息最大允许传输的数据包大小。
如果单条SQL插入或更新的数据包超过此大小,就会报错:
[ERR] 1153 - Got a packet bigger than 'max_allowed_packet' bytes
官方解释:
max_allowed_packet sets an upper limit on the size of any single message between the MySQL server and clients, including replication slaves. If you are replicating large column values (such as might be found in TEXT or BLOB columns) and max_allowed_packet is too small on the master, the master fails with an error, and the slave shuts down the I/O thread. If max_allowed_packet is too small on the slave, this also causes the slave to stop the I/O thread.