> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_server_version.md).

# mysql\_get\_server\_version

## Syntax

```c
unsigned long mysql_get_server_version(MYSQL * mysql);
```

## Parameter

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

## Description

Returns an integer representing the version of connected server.

## Return Value

The version number of the connected server.

{% hint style="info" %}
The form of the version number is `VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH`
{% endhint %}

## See Also

* [mysql\_get\_server\_info()](/docs/connectors/mariadb-connector-c/api-functions/mysql_get_server_info.md)

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