MariaDB Connector/C

C developers can connect to MariaDB Platform through a native MariaDB Connector Using MariaDB Connector/C, you can connect to MariaDB Platform to use and administer databases from within your C application.

Installation

MariaDB Connector/C is available in the development files for MariaDB Enterprise Server. You can install it using your distribution's package manager or download the binaries.

Install via YUM (RHEL/CentOS)

To install MariaDB Connector/C on RHEL and CentOS, you can use YUM. First, you must configure MariaDB Corporation's YUM repository, if you have not already done so.

  1. Retrieve your Customer Download Token at https://customers.mariadb.com/downloads/token/ and substitute for customer_download_token in the following directions.

  2. Configure the YUM package repository.

    Installable versions of MariaDB Enterprise Server are 10.5, 10.4, 10.3, and 10.2. Pass the version to install using the --mariadb-server-version flag to mariadb_es_repo_setup. The following directions reference 10.5. All versions of MariaDB Enterprise Server contain the same version of MariaDB Connector/C.

    To configure YUM package repositories:

    $ sudo yum install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "957bc29576e8fd320fa18e35fa49b5733f3c8eeb4ca06792fb1f05e089c810ff mariadb_es_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_es_repo_setup
    
    $ sudo ./mariadb_es_repo_setup --token="customer_download_token" --apply \
       --mariadb-server-version="10.5"
    
  3. Install MariaDB Connector/C and package dependencies:

    $ sudo yum install MariaDB-shared MariaDB-devel
    

Install via APT (Debian/Ubuntu)

To install MariaDB Connector/C on Debian and Ubuntu, you can use APT. First, you must configure MariaDB Corporation's APT repository, if you have not already done so.

  1. Retrieve your Customer Download Token at https://customers.mariadb.com/downloads/token/ and substitute for customer_download_token in the following directions.

  2. Configure the APT package repository.

    Installable versions of MariaDB Enterprise Server are 10.5, 10.4, 10.3, and 10.2. Pass the version to install using the --mariadb-server-version flag to mariadb_es_repo_setup. The following directions reference 10.5. All versions of MariaDB Enterprise Server contain the same version of MariaDB Connector/C.

    To configure APT package repositories:

    $ sudo apt install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "957bc29576e8fd320fa18e35fa49b5733f3c8eeb4ca06792fb1f05e089c810ff mariadb_es_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_es_repo_setup
    
    $ sudo ./mariadb_es_repo_setup --token="customer_download_token" --apply \
       --mariadb-server-version="10.5"
    
    $ sudo apt update
    
  3. Install MariaDB Connector/C and package dependencies:

    $ sudo apt install libmariadb3 libmariadb-dev
    

Install via ZYpp (SLES)

To install MariaDB Connector/C on SLES, you can use ZYpp. First, you must configure MariaDB Corporation's ZYpp repository, if you have not already done so.

  1. Retrieve your Customer Download Token at https://customers.mariadb.com/downloads/token/ and substitute for customer_download_token in the following directions.

  2. Configure the ZYpp package repository.

    Installable versions of MariaDB Enterprise Server are 10.5, 10.4, 10.3, and 10.2. Pass the version to install using the --mariadb-server-version flag to mariadb_es_repo_setup. The following directions reference 10.5. All versions of MariaDB Enterprise Server contain the same version of MariaDB Connector/C.

    To configure ZYpp package repositories:

    $ sudo zypper install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "957bc29576e8fd320fa18e35fa49b5733f3c8eeb4ca06792fb1f05e089c810ff mariadb_es_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_es_repo_setup
    
    $ sudo ./mariadb_es_repo_setup --token="customer_download_token" --apply \
       --mariadb-server-version="10.5"
    
  3. Install MariaDB Connector/C and package dependencies:

    $ sudo zypper install MariaDB-shared MariaDB-devel
    

Install via Download

To install MariaDB Connector/C on other distributions or operating systems, binary tar files are available at:

https://mariadb.com/downloads/#connectors

Select the MariaDB Connector, version, and operating system, then download the .tar.gz file.

Connections

MariaDB Connector/C allows you to establish client connections from within your C applications. These client connections can be made to MariaDB Platform components, such as:

Component

Description

MariaDB Enterprise Server

100% Open Source modern SQL database with enterprise-grade enhancements

MariaDB ColumnStore

Distributed, columnar storage engine for scalable analytical processing

MariaDB Xpand

Distributed SQL, high availability, and fault tolerance for scale-out transactional workloads

MariaDB MaxScale

Advanced database proxy, firewall, and query router

MariaDB Connector/C can also be used to connect to MariaDB SkySQL and MariaDB Community Server from within your C applications.