MySQL packets

All communication between MySQL clients and servers is done through discrete packets. Some packet types can be sent by the client to the server, others by the server to the client, and a few can be sent from either side.

For full details, consult the MySQL documentation.

Request packets

These packet types can only be sent from the client to the server.

AuthSwitchResponse: responds to an AuthSwitchRequest

HandshakeResponse41: the first packet sent by the client

Command packet: asks the server to do something

StmtExecute: requests the execution of a prepared statement

Response packets

These packet types can only be sent from the server to the client.

AuthSwitchRequest: requests the use of a a new authentication method

ColumnCount: indicates how many columns are in a result set

ColumnDefinition: describes a column

EOF: indicates the end of a stream of data

ERR: indicates an error

FieldListResponse: lists columns in response to a FieldList request

HandshakeV10: sent by the server on initial connection

OK: sent to indicate the successful completion of an exchange

ResultsetRow: contains a row in a result set

StmtExecuteResponse: response to the execution of a prepared statement

StmtPrepareOK: response to a prepare statement

Duplex packets

These packet types can be sent either from the client or from the server.

Authentication: authentication data exchanged during authentication

AuthMoreData: additional authentication data exchanged during authentication