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.
These packet types can only be sent from the client to the server.
LoginRequest: starts the authentication process
AuthSwitchResponse: responds to an AuthSwitchRequest
HandshakeResponse41: the first packet sent by the client
Command packet: asks the server to do something
Query packet: asks the server to execute a SQL command
StatementClose packet: closes a prepared statement
StatementReset packet: reset a prepared statement
StmtExecute: requests the execution of a prepared statement
StatementPrepare: prepare a prepared statement
These packet types can only be sent from the server to the client.
AuthMoreData: opaque packet used in authentication
AuthSwitchRequest: requests the use of 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