Note
This variable is available starting with V3.2.3.
Description
max_allowed_packet specifies the maximum size of a network packet.
Privilege requirements
Query variables
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle-compatible mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to obtain the values of global system variables.Modify variables
systenants can directly modify the values of global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the values of global system variables.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | 16777216 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 this variable in Global mode. You cannot execute theSET SESSIONstatement to modify the value of this variable in Session mode.When you use this variable, you must modify the values 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 bytes.
obclient> SET GLOBAL max_allowed_packet=16777216;