MySQL 9.0.0
Source Code Documentation
Connection Lifecycle

The MySQL protocol is a stateful protocol.

When a connection is established the server initiates a Connection Phase. Once that is performed the connection enters the Command Phase. The Command Phase ends when the connection terminates.

The connection can also enter Replication Protocol from Connection Phase if one of the replication commands is sent.

Further reading: