unsigned int mysql_get_proto_info(MYSQL *mysql)
Returns the MySQL protocol version used in the current connection as an integer. As a general rule, the MySQL network protocol changes only between minor releases of MySQL. That is, all releases of MySQL 3.23.x should have the same protocol version number.
printf("This connection is using MySQL connection protocol ver. %d\n", mysql_get_proto_info( ));