You can call the mysql_get_host_info() function to return a string that describes the current connection type, including the server host name.
Syntax
const char *
mysql_get_host_info(MYSQL *mysql)
Return values
A string representing the server host name and the connection type is returned.
Errors
None.