From Fedora Project Wiki

(Make the info up-to-date)
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:


mariadb-connector-c 3.0 - until Fedora 28 ( also available in F29 & F30 base ) <br />
mariadb-connector-c 3.0 - until Fedora 28 ( also available in F29 & F30 base ) <br />
'''mariadb-connector-c 3.1''' - current ( F29 - '''F35''' ) <br />
mariadb-connector-c 3.1 - until Fedora 35 <br />
'''mariadb-connector-c 3.2''' - current '''( F36 - Rawhide )''' <br />
mariadb-connector-c 3.2 - until Fedora 36 <br />
 
'''mariadb-connector-c 3.3''' - current '''( F36 - F41 )''' <br />
In Fedora<=26 the connector does not work. It is built on top of old mysql client library, which lead to lot of issues.<br/>
'''mariadb-connector-c 3.4''' - current '''( F42 - Rawhide )''' <br />
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.<br />
At the upstream, the connector-c is developed as a git submodule of mariadb server.<br />
Line 48: Line 47:
== Notes ==
== Notes ==


[https://mariadb.com/kb/en/library/about-mariadb-connector-c/ Upstream infromation]<br />
Upstream [https://mariadb.com/kb/en/library/about-mariadb-connector-c/ information] <br />
Upstream [https://mariadb.com/kb/en/mariadb-connector-c-release-notes/ release notes] <br />
[https://mariadb.com/kb/en/library/mariadb-connectorc-api-functions/ API reference]
[https://mariadb.com/kb/en/library/mariadb-connectorc-api-functions/ API reference]



Latest revision as of 23:53, 17 January 2025

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 - until Fedora 35
mariadb-connector-c 3.2 - until Fedora 36
mariadb-connector-c 3.3 - current ( F36 - F41 )
mariadb-connector-c 3.4 - current ( F42 - Rawhide )

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.
http://zetcode.com/db/mysqlc/

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());
  return;
}

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.

Notes

Upstream information
Upstream release notes
API reference