Installation From Source

Prerequisites

MyTile Requires TileDB to be installed on the system (see TileDB Installation). You can install all the other dependencies as follows.

Fedora
Centos
Ubuntu
macOS
dnf builddep mariadb-server
yum install git \
gcc \
gcc-c++ \
bison \
libxml2-devel \
libevent-devel \
rpm-build
apt-get build-dep mariadb-server
brew install cmake jemalloc traildb/judy/judy openssl boost gnutls

Depending on your platform there may be other dependencies needed. See https://mariadb.com/kb/en/library/compiling-mariadb-from-source/ for details.

Compiling

When compiling from source, you will need to fetch the MariaDB server and then build MariaDB with the MyTile source included. You must build MariaDB and MyTile together in one source tree, as MariaDB requires that all compilation flags and optimizations be the same between the server and the plugins.

For simplicity the cmake command below disables many of the optional storage engines to reduce the build size. You can toggle each storage engine as you see fit.

The CMAKE_INSTALL_PREFIX can also be set to switch locations of the installation. By default, we set it to $HOME/mytile_server

git clone git@github.com:MariaDB/server.git -b 10.4
cd server
git submodule add https://github.com/TileDB-Inc/TileDB-MariaDB.git storage/mytile
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/mytile_server -DPLUGIN_TOKUDB=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_MROONGA=NO -DPLUGIN_SPIDER=NO -DPLUGIN_SPHINX=NO -DPLUGIN_FEDERATED=NO -DPLUGIN_FEDERATEDX=NO -DPLUGIN_CONNECT=NO -DCMAKE_BUILD_TYPE=Release -DPLUGIN_MYTILE=YES
make -j4
make install

After the compilation has completed, in $HOME/mytile_server you will have MariaDB 10.4 with a working MyTile plugin.

Configuring

By default optional plugins are not loaded. You will need to edit the MariaDB configuration to load the plugin. Full configuration of MariaDB is beyond our scope as there is a plethora of options outside of MyTile settings.

Edit your ~/.my.cnf, under the [mysqld] section add plugin-load-add=mytileand plugin-maturity=experimental . If you do not /.my.cnf file, a sample one is provided below:

# /mysql-data-dir/my.cnf to get server specific options or
# ~/my.cnf for user specific options.
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options
# This will be passed to all mysql clients
[client]
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# The MySQL server
[mysqld]
port=3306
plugin-load-add=ha_mytile
######### Fix the two following paths
# Where you want to have your database
#datadir=~/mytile_server/data
# Where you have your mysql/MariaDB source + sql/share/english
language=~/mytile_server/share/english
plugin_dir=~/mytile_server/lib/plugin
plugin-maturity=experimental

Running

Now that you have installed and configured MariaDB, you can run the server. First you need to run MariaDB's setup script to initialize the server:

~/mytile_server/scripts/mysql_install_db

After the database has been initialized, in a terminal start the server with:

~/mytile_server/bin/mariadbd

This will launch the server in your terminal. After the server is successfully started, you can connect with:

~/mytile_server/bin/mariadb