Install MariaDB Connector/C++

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 NotesMariaDB Connector/C++ Release Notes".

Linux Installation (Binary Tarball)

To install MariaDB Connector/C++ on Linux:

  1. Install MariaDB Connector/C.

  2. Go to the MariaDB Connector C++ download page.

  3. In the "OS" dropdown, select the Linux distribution you want to use.

  4. Click the "Download" button to download the binary tarball.

  5. Extract the tarball:

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

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

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

    $ 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
    
  9. Install the directories for the shared libraries:

    • On CentOS, RHEL, Rocky Linux:

      $ sudo install -d /usr/lib64/mariadb
      $ sudo install -d /usr/lib64/mariadb/plugin
      
    • On Debian, Ubuntu:

      $ sudo install -d /usr/lib/mariadb
      $ sudo install -d /usr/lib/mariadb/plugin
      
  10. Install the shared libraries:

    • On CentOS, RHEL, Rocky Linux:

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

      $ 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 for MS Windows.

  3. Click the "Download" button to download the MSI package.

  4. Run the MSI package and click "Next" to start the Setup Wizard.

  5. On the second screen, click the license agreement checkbox, then click "Next."

  6. On the third screen, click "Typical."

  7. On the fourth screen, click "Install."

  8. Click "Finish."

  9. Add the directory path that contains the mariadbcpp LIB file (example "C:\Program Files\MariaDB\MariaDB C++ Connector 64-bit") to PATH environment variable.