Linux – How to combine Zabbix with MariaDB

linuxmariadbMySQLUbuntuzabbix

Ubuntu Server 13.04; Zabbix actual version from source code; MariaDB 5.5

Fistly I've download and unpack Zabbix source code. After that:

./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl

But an error occurs. From log:

configure:7488: checking for mysql_config 
configure:7521: result: no 
configure:7719: error: MySQL library not found

How can I fix that? For example, phpmyadmin see libmysql – 5.5.31-MariaDB and I have libmysqlclient18 installed too:

libmysqlclient18 is already the newest version.
libmysqlclient18 set to manually installed.

Try to force define path to libs:

--with-mysql=/usr/lib/

Server answer:

checking for mysql_config... /usr/lib/
./configure: line 7529: /usr/lib/: Is a directory
./configure: line 7531: /usr/lib/: Is a directory

I don't really know if it's error or just warning and it already found library.

Trying to install -dev packet:

mammuthus@server:~/zabbix-2.0.6$ sudo apt-get install libmysqlclient-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libmysqlclient-dev : Depends: libmysqlclient18 (= 5.5.31-0ubuntu0.13.04.1) but 5.5.31+maria-1~raring is to be installed
E: Unable to correct problems, you have held broken packages.

Okay

mammuthus@server:~/zabbix-2.0.6$ sudo apt-get install libmysqlclient18
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmysqlclient18 is already the newest version.

So i already have -dev tools, yep?

Best Answer

It looks like you are missing the development headers for MariaDB.

Provided you are using the MariaDB repositories for Ubuntu 13, try installing libmariadbdclient-dev from that repository.

You could even manually download the *-dev package from one of the mirrors to check it:

# atool -l libmariadbclient-dev_5.5.31+maria-1~raring_amd64.deb | grep mysql_config
-rwxr-xr-x root/root      6764 2013-05-22 01:48 ./usr/bin/mysql_config
-rw-r--r-- root/root      2127 2013-05-22 02:20 ./usr/share/man/man1/mysql_config.1.gz

For comprehensive instructions on how to build a package from the upstream Zabbix sources check here.