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
sysand all user tenants can query the value of a global system variable by using theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL mode).Modify variables
systenants can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
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 the global scope. You cannot execute theSET SESSIONstatement to modify the value of themax_allowed_packetvariable in the session scope.When you use the
max_allowed_packetvariable, you need to adjust the value on both the client and server sides. If the values on the two sides are inconsistent, an errorERROR 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;
