Each client connection gets its own thread within the MySQL process. All the client queries are handled by that thread. The threads are pooled for efficiency. Authentication is based on the username and password. X.509 certificates can also be used across an SSL connection. Once a client has been authenticated, the server verifies whether the client has the right authorization for the query.