# MariaDB Connector/C Guide

## MariaDB Connector/C Quickstart Guide

This guide will help you quickly get started with **MariaDB Connector/C**, the client library used to connect C/C++ applications to MariaDB and MySQL databases. It's LGPL licensed and is being integrated directly into MariaDB Server distributions.

### Installation

MariaDB Connector/C is often distributed with MariaDB Server packages, but you can also install it separately.

#### Download Packages

You can download MariaDB Connector/C packages directly:

* **From the downloads page:** Select your desired version from the main MariaDB Connector/C download page.
* **By product selection:** Choose "C/C++ connector" as the Product on the MariaDB downloads page.

#### Install with a Package Manager (Recommended for Linux)

If you're using Linux, the simplest way to install MariaDB Connector/C is via your system's package manager. Your system needs to be configured to install from a MariaDB repository (version 10.2 or later).

You can set up your repository using:

* MariaDB Corporation's [MariaDB Package Repository setup script](/docs/server/server-management/install-and-upgrade-mariadb/mariadb-package-repository-setup-and-usage.md).
* MariaDB Foundation's [MariaDB Repository Configuration Tool](broken://spaces/SsmexDFPv2xG2OTyO5yV/pages/0B9HhpsUkjLe15Lk8wbL).

**Install with `yum`/`dnf` (RHEL, CentOS, Fedora)**

For RHEL, CentOS, Fedora, and similar distributions, use `yum` or `dnf`:

To install the shared library:

```bash
sudo yum install MariaDB-shared
```

To install the development package (if you're building applications):

```bash
sudo yum install MariaDB-devel
```

**Install with `apt-get` (Debian, Ubuntu)**

For Debian, Ubuntu, and similar distributions, use `apt-get`:

To install the shared library:

```bash
sudo apt-get install libmariadb3
```

To install the development package (if you're building applications):

```bash
sudo apt-get install libmariadb-dev
```

**Install with `zypper` (SLES, OpenSUSE)**

For SLES, OpenSUSE, and similar distributions, use `zypper`:

To install the shared library:

```bash
sudo zypper install MariaDB-shared
```

To install the development package (if you're building applications):

```bash
sudo zypper install MariaDB-devel
```

#### Install on Windows

MariaDB Connector/C for Windows is distributed as MSI packages. The installation process is straightforward, with both 32-bit and 64-bit MSI packages available.

#### Install from Source

If you prefer to build from source, refer to the [Building Connector/C From Source](/docs/connectors/mariadb-connector-c/building-connectorc-from-source.md) documentation.

### API Reference

MariaDB Connector/C provides an API that is compatible with MySQL Connector/C for MySQL 5.5.

You can find the function reference at:

* [MariaDB Client Library for C API Functions](/docs/connectors/mariadb-connector-c/api-functions.md)
* [MariaDB Client Library for C API Prepared Statement Functions](/docs/connectors/mariadb-connector-c/api-prepared-statement-functions.md)

An HTML version is also available for download in `mariadb-client-doc.zip`.

### Configuration with Option Files

Similar to MariaDB Server, MariaDB Connector/C can read configuration options from client option groups in option files.

For detailed information, see [Configuring MariaDB Connector/C with Option Files](/docs/connectors/mariadb-connector-c/configuring-mariadb-connectorc-with-option-files.md).

### Known Issues

Be aware of these potential limitations:

* Double-to-string conversion for prepared statements may not work correctly.
* Connector versions 3.0.7 and below do not support MySQL 8.0's default authentication protocol, `caching_sha2_password`. This should be supported in Connector/C 3.0.8 and above.

### Need Help or Want to Contribute?

* **Report Bugs:** If you encounter a bug, please report it via the [CONC project on MariaDB's Jira bug tracker](https://jira.mariadb.org/browse/CONC).
* **Source Code:** The source code is available on GitHub in the [mariadb-connector-c repository](https://github.com/MariaDB/mariadb-connector-c).

## License

GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

For licensing questions, see the [Licensing FAQ](/docs/general-resources/community/community/faq/licensing-questions/licensing-faq.md).

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/connectors/connectors-quickstart-guides/mariadb-connector-c-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
