mysql_get_host_info()
char *mysql_get_host_info(MYSQL *mysql)
This function returns the hostname and the connection type for the current connection. Here is an example:
...
MYSQL *mysql;
mysql = mysql_init(NULL);
mysql_real_connect(mysql,"localhost","marie","password",
NULL,0,NULL,0);
printf("Host Info: %s \n", mysql_get_host_info(mysql));
mysql_close(mysql);
...The results of this program excerpt will look something like the following:
Host Info: Localhost via UNIX socket