Name

mysql_get_server_info( )

Synopsis

char *mysql_get_server_info(MYSQL *mysql)

This returns a string containing the version of MySQL running on the server for the current connection.

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

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.