From Fedora Project Wiki

Article about the mariadb-connector-c package

Connector releases

mariadb-connector-c 3.0 - until Fedora 28 ( also available in F29 & F30 base )
mariadb-connector-c 3.1 - current ( F29 - F35 )
mariadb-connector-c 3.2 - current ( F36 - Rawhide )

In Fedora<=26 the connector does not work. It is built on top of old mysql client library, which lead to lot of issues.
In Fedora 27 the connector package is empty and requires mariadb-devel and mariadb-libs, which contains all of the files that would be in the connector.

At the upstream, the connector-c is developed as a git submodule of mariadb server.
That means every new release of mariadb has the latest connector c code inside.

Developement of 3rd software

All packages that required mysql-devel, mariadb-devel or community-mysql-devel should now require mariadb-connector-c-devel instead.
(#1486480 and proposal)

Only software that needs to develop against the server (for example building custom server plugins or application with embedded database) should use mariadb-devel.

By this approach, client and server parts were successfuly divided.

Usage examples

I would recommend this website, often referenced on the internet, as a good example and tutorial for writing C code with this connector.

It is originally written for mysql connector c, but they are more or less compatible.

You can also try following code:

#include <stdio.h>
#include <mysql.h>

void main()
  printf("MySQL client version: %s\n", mysql_get_client_info());

Compiled with:

gcc mariadb_code.c -o mariadb_program `mariadb_config --cflags --libs`

The invocation of mariadb_config --cflags will set the correct path to search header files in.


Upstream infromation
API reference