mysql_get_proto_info —


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(  ));

Get Managing & Using MySQL, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.