Note
`max_allowed_packet` is available starting with V3.2.3.
Description
max_allowed_packet specifies the maximum size of a network packet.
Privilege requirements
Query variables
The
systenant and all user tenants can query the value of Global system variables by using theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) and theinformation_schema.GLOBAL_VARIABLESview (MySQL mode).Modify variables
The
systenant can directly modify the value of Global system variables.A MySQL user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of Global system variables.An Oracle user tenant must have the
ALTER SYSTEMprivilege to modify the value of Global system variables.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 16777216, in bytes.
NoteStarting from V4.2.1, the default value is changed from 4194304 to 16777216. |
| Value range | [1024, 1073741824] |
| Scope | Global |
| Modifiable | Yes. You can execute the SET GLOBAL statement to modify the value. |
Usage
You can execute the
SET GLOBALstatement to modify the value of themax_allowed_packetvariable in Global mode. You cannot execute theSET SESSIONstatement to modify the value of themax_allowed_packetvariable in Session mode.When you use this variable, you need to adjust the value on both the client and server sides. If the values on the two sides are inconsistent, an error
ERROR 1153 (08S01) : Got a packet bigger than 'max_allowed_packet' bytesis returned.
Examples
Set the maximum size of a network packet to 16777216.
obclient> SET GLOBAL max_allowed_packet=16777216;