You can call the mysql_get_proto_info() function to return the protocol version used for the current connection.
Syntax
unsigned int
mysql_get_proto_info(MYSQL *mysql)
Return values
An unsigned integer representing the protocol version used for the current connection is returned.
Errors
None.