How to use the latest version of MariaDB 10.5.8 and Mroonga 10.11 in Debian Buster

MariaDB, Mroonga, Debian

Josep Sanz

The follow lines explain how to install MariaDB 10.5.8 with Mroonga 10.11 in Debian Buster, for this you must install the MariaDB and Groonga repositories, I also put some links with documentation of what will be explained below:

The first thing is to install the repositories as documented in the first and second links to install MariaDB 10.5.8 and the Groonga libraries from the official repositories of each project.
sudo apt install mariadb-server
apt install groonga-normalizer-mysql libgroonga-dev libgroonga0

With this, we will have already installed MariaDB 10.5.8 and the Groonga libraries.

If we want to install the Mroonga plugin using the available package, we have to do an "apt install mariadb-plugin-mroonga", this will install the available version, which is currently 7.07, to be able to use the latest version, 10.11 , the only solution is to compile the plugin manually and obtain the file ha_mroonga.so which is the binary file of the plugin that you want to update.

To compile the mroonga plugin downloaded directly from the Mroonga project website, it is necessary to have the sources of the MariaDB version being used and the MariaDB compilation directory that is being used, this requirement is because it is needed the libpeftschema.a file to compile the Mroonga plugin, with which the following steps must be followed:

1) The first step is to download and compile MariaDB 10.5.8
apt source mariadb-10.5
cd mariadb-10.5-10.5.8+maria~buster
dpkg-buildpackage -rfakeroot -Tbuild
cd ..

The first line should download the source code for the MariaDB 10.5.8 we are using and the third line should compile MariaDB in the builddir directory, which is what we need to later compile Mroonga.

2) The next step is to download Mroonga and compile the plugin:
wget https://packages.groonga.org/source/mroonga/mroonga-10.11.tar.gz
tar xvzf mroonga-10.11.tar.gz
cd mroonga-10.11/
./configure \
--with-mysql-source=../mariadb-10.5-10.5.8+maria~buster/ \
--with-mysql-config=../mariadb-10.5-10.5.8+maria~buster/builddir/scripts/mysql_config \
cd ..

Once this is finished, we must have in the .libs directory the file ha_mroonga.so.0.0.0, which is the newly compiled plugin.

3) The next step is to copy the plugin file to the MariaDB plugin directory and activate the plugin:
sudo cp .libs/ha_mroonga.so.0.0.0 /usr/lib/mysql/plugin/ha_mroonga.so
sudo cp data/install.sql /usr/lib/mysql/plugin/
sudo cp data/uninstall.sql /usr/lib/mysql/plugin/
cat /usr/lib/mysql/plugin/install.sql | mysql -uroot -p
echo "show engines;" | mysql -uroot -p -t
echo "show variables like 'mroonga%';" | mysql -uroot -p -t

The first three lines will copy the plugin + 2 SQL scripts that add and remove the MariaDB plugin, the fourth line executes the plugin registration script to install it and the last two lines simply check that the plugin has been installed correctly.

Note: I have tested that all the above works also for the 11.00 version of mroonga, just change 10.11 to 11.00 and voila.

XML lines
PHP lines
JS lines
T2T lines
XSLT lines
SQL lines