mysql_get_server_info()
char *mysql_get_server_info(MYSQL *mysql)
This function returns a string containing the version of MySQL running on the server for the current connection. Here is an example:
...
MYSQL *mysql;
mysql = mysql_init(NULL);
mysql_real_connect(mysql,"localhost","root","password",
NULL,0,NULL,0);
printf("Server Version: %s \n", mysql_get_server_info(mysql));
mysql_close(mysql);
...