> 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-cpp/install-mariadb-connector-cpp.md).

# Install MariaDB Connector/C++

{% hint style="info" %}
**Browse & download the latest MariaDB connectors**

<a href="https://mariadb.com/downloads/connectors/?utm_source=onpagepromo&#x26;utm_medium=kb" class="button primary">Download Connectors</a>
{% endhint %}

## Requirement

MariaDB Connector/C++ has dependencies. You must install MariaDB Connector/C to use it.

| MariaDB Connector/C++ | MariaDB Connector/C |
| --------------------- | ------------------- |
| 1.1                   | 3.3.3 or later      |
| 1.0                   | 3.1.1 or later      |

For additional information, see "[MariaDB Connector/C++ Release Notes](/docs/release-notes/connectors/c++/all-releases.md)".

## Linux Installation (RPM and DEB Packages)

To install MariaDB Connector/C++ on Linux using RPM or DEB packages:

1. Ensure that the [MariaDB Connector/C](/docs/connectors/mariadb-connector-c/install-mariadb-connector-c.md) dependency is installed first.
2. Go to the [MariaDB Connector/C++ download page](https://mariadb.com/downloads/connectors/connectors-data-access/cpp-connector/).
3. Ensure the **Product** dropdown reads **C++ connector.**
4. In the **Version** dropdown, select the desired version.
5. Under the **OS** dropdown:
   * Select a Debian-based distribution to download a `.deb` package (e.g., `Debian 12 Bookworm (64-bit x86) deb`)
   * Select an RPM-based distribution (RHEL, Rocky, or AlmaLinux) to download a `.rpm` package (e.g., `RHEL 9 / Alma 9 / Rocky 9 (64-bit x86) rpm`).
6. Click **Download** to save the appropriate package to your local system.

**Install on RPM-based systems (RHEL and Rocky)**

Navigate to the directory where the file was downloaded and run:

```sql
sudo dnf install mariadb-connector-cpp-*.rpm
```

**Install on Debian/Ubuntu**

Navigate to the directory where the file was downloaded and run:

```sql
sudo apt update
sudo apt install ./mariadb-connector-cpp-*.deb
```

## Linux Installation (Binary Tarball)

To install MariaDB Connector/C++ on Linux:

1. Install [MariaDB Connector/C](/docs/connectors/mariadb-connector-c/install-mariadb-connector-c.md).
2. Go to the [MariaDB Connector C++ download page](https://mariadb.com/downloads/connectors/connectors-data-access/cpp-connector).
3. Ensure the "Product" dropdown reads "C++ connector."
4. In the "Version" dropdown, select the version you want to download.
5. In the "OS" dropdown, select the Linux distribution you want to use. For the binary tarball, select the `tar.gz` option.
6. Click the "Download" button to download the binary tarball.
7. Extract the tarball:

   ```bash
   $ tar -xvzf mariadb-connector-cpp-*.tar.gz
   ```
8. Change into the relevant directory:

   ```bash
   $ cd mariadb-connector-cpp-*/
   ```
9. Install the directories for the header files:

   ```bash
   $ sudo install -d /usr/include/mariadb/conncpp
   $ sudo install -d /usr/include/mariadb/conncpp/compat
   ```
10. Install the header files:

    ```bash
    $ sudo install include/mariadb/* /usr/include/mariadb/
    $ sudo install include/mariadb/conncpp/* /usr/include/mariadb/conncpp
    $ sudo install include/mariadb/conncpp/compat/* /usr/include/mariadb/conncpp/compat
    ```
11. Install the directories for the shared libraries:

* On CentOS, RHEL, Rocky Linux:

  ```bash
  $ sudo install -d /usr/lib64/mariadb
  $ sudo install -d /usr/lib64/mariadb/plugin
  ```
* On Debian, Ubuntu:

  ```bash
  $ sudo install -d /usr/lib/mariadb
  $ sudo install -d /usr/lib/mariadb/plugin
  ```

1. Install the shared libraries:

* On CentOS, RHEL, Rocky Linux:

  ```bash
  $ sudo install lib/mariadb/libmariadbcpp.so /usr/lib64
  $ sudo install lib/mariadb/plugin/* /usr/lib64/mariadb/plugin
  ```
* On Debian, Ubuntu:

  ```bash
  $ sudo install lib/mariadb/libmariadbcpp.so /usr/lib
  $ sudo install lib/mariadb/plugin/* /usr/lib/mariadb/plugin
  ```

## Windows Installation (MSI)

To install MariaDB Connector/C++ on Windows:

1. MariaDB Connector/C dependency will be installed when Connector/C++ is installed.
2. Go to the [MariaDB Connector C++ download page](https://mariadb.com/downloads/connectors/connectors-data-access/cpp-connector)
3. Ensure the "Product" dropdown reads "C++ connector."
4. In the "Version" dropdown, select the version you want to download.
5. In the "OS" dropdown, select "MS Windows (64-bit)" when a 64‑bit connector is required.
6. Click the "Download" button to download the MSI package.
7. Run the MSI package and click "Next" to start the Setup Wizard.
8. On the second screen, click the license agreement checkbox, then click "Next."
9. On the third screen, click "Typical."
10. On the fourth screen, click "Install."
11. Click "Finish."
12. Add the directory path that contains the `mariadbcpp LIB` file (for example, `C:\Program Files\MariaDB\MariaDB C++ Connector 64-bit`) to your `PATH` environment variable.

<sub>*This page is: Copyright © 2025 MariaDB. All rights reserved.*</sub>

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://mariadb.com/docs/connectors/mariadb-connector-cpp/install-mariadb-connector-cpp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
