# mysql\_get\_host\_info

## Syntax

```c
const char * mysql_get_host_info(MYSQL * mysql);
```

* `mysql` - a mysql handle, which was previously allocated by [mysql\_init()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_init) or [mysql\_real\_connect()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_real_connect).

## Description

Describes the type of connection in use for the connection, including the server host name. Returns a string, or NULL if the connection is not valid.

## See also

* [mysql\_get\_server\_version()](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_server_version)

{% @marketo/form formId="4316" %}
