MySQL 8.0.39
Source Code Documentation
|
If a MySQL client or server wants to send data, it:
Data between client and server is exchanged in packets of max 16MByte size.
Type | Name | Description |
---|---|---|
int<3> | payload_length | Length of the payload. The number of bytes in the packet beyond the initial 4 bytes that make up the packet header. |
int<1> | sequence_id | Sequence ID |
string<var> | payload | payload of the packet |
Example:
01 00 00 00 01
|
|
If the payload is larger than or equal to 224-1 bytes the length is set to 224-1 (ff ff ff
) and a additional packets are sent with the rest of the payload until the payload of a packet is less than 224-1 bytes.
Sending a payload of 16 777 215 (224-1) bytes looks like:
The sequence-id is incremented with each packet and may wrap around. It starts at 0 and is reset to 0 when a new command begins in the Command Phase.
In this document we describe each packet by first defining its payload and provide an example showing each packet that is sent, including its packet header:
<packetname> <description> direction: client -> server response: <response> payload: <type> <description>
Example:
If a field has a fixed value, its description shows it as a hex value in brackets like this: [00]