mariadb-connector-cpp-install

Installs and configures MariaDB Connector/C++ across Linux packages, tarballs, and Windows MSI.

28|115|Updated Jan 28, 2025
One-click install
npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-connector-cpp-install-mariadb-corporation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mariadb-connector-cpp-install
Source: https://github.com/mariadb-corporation/mariadb-docs/tree/main/agent-skills/granular/connectors/mariadb-connector-cpp-install
Command: npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-connector-cpp-install-mariadb-corporation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up MariaDB Connector/C++ fails in predictable ways: the Connector/C prerequisite is missed on Linux, the binary tarball install is left half-done without the authentication plugin directory, and applications link the wrong header or library. This Skill walks through each installation path and the compile, link, and runtime checks that confirm a working setup. ## Core Features & Use Cases - Dependency and version management: Enforces the Connector/C prerequisite (3.1.1+ for Connector/C++ 1.0, 3.3.3+ for 1.1) and explains why the connector is downloaded per platform rather than from the server package repository. - Complete tarball installation: Covers all four file groups — headers, compatibility headers, the library, and the easily forgotten plugin directory — with the correct lib vs lib64 paths per distribution. - Build and link guidance: Shows compiling with -std=c++11, linking -lmariadbcpp, including mariadb/conncpp.hpp, and configuring connections through sql::Properties. - Use Case: A developer on Rocky Linux downloads the Connector/C++ tarball, copies only libmariadbcpp.so, and hits authentication failures at runtime. This Skill identifies the missing lib64/mariadb/plugin directory and completes the install. ## Quick Start Install MariaDB Connector/C++ on my Debian system and show me how to compile and verify a minimal C++ application against it.

Frequently Asked Questions about mariadb-connector-cpp-install

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install MariaDB Connector/C++ on Linux?▼

Install MariaDB Connector/C first (libmariadb3 and libmariadb-dev on Debian/Ubuntu, MariaDB-shared and MariaDB-devel on RHEL/Rocky), then install the Connector/C++ package downloaded from the MariaDB download page. It is not available from the server package repository.

How to compile a C++ application with MariaDB Connector/C++?▼

Compile with g++ -std=c++11 app.cpp -lmariadbcpp -o app and include <mariadb/conncpp.hpp>. The connector headers require C++11 or later, and the library name is mariadbcpp, not the C API's mysqlclient.

Does MariaDB Connector/C++ require Connector/C?▼

Yes, Connector/C is a hard prerequisite on Linux: version 3.1.1 or later for Connector/C++ 1.0, and 3.3.3 or later for 1.1. On Windows, the MSI installer brings Connector/C along automatically.

Why does MariaDB Connector/C++ fail authentication after connecting?▼

Authentication failures right after connecting usually mean the plugin directory was not installed. The binary tarball's lib/mariadb/plugin files must be copied alongside the library, or authentication plugins the server requests will not load.

Can I install MariaDB Connector/C++ with apt or dnf from the MariaDB repository?▼

No, Connector/C++ is not part of the MariaDB server package repository. Download the .deb, .rpm, tarball, or MSI for your platform from the MariaDB Connector/C++ download page, then install the downloaded file locally.

Does the Connector/C++ version need to match the MariaDB server version?▼

No, connector versions are independent of the server version. Pin Connector/C++ and Connector/C to each other using the compatibility rule (3.1.1+ for 1.0, 3.3.3+ for 1.1), regardless of which server version you run.