Skip to content

mariadb

Martin Vanbrabant edited this page Jan 17, 2019 · 1 revision

MariaDB

Note These instructions are valid for MariaDB 10.0, as that is the (default) version on Ubuntu 16.04.

The TCBL User Data Manager requires a database to store information about its users. On one hand information that is not contained in the Gluu Server, but on the other hand information that is stored in the Gluu server for performance reasons (querying Gluu using SCIM over HTTP is slow) and for comfort reasons (inspecting a relational database is easy). We choose MariaDB (but another solution might work as well).

All commands are to be run as root unless specified otherwise

Installation

Because the server has an extra data share mounted on /srv, we will put the data directory of MariaDB there somewhere.

install MariaDB:

apt install mariadb-client mariadb-server

Create the future data path and make it owned by the mysql user and group:

mkdir -p /srv/var/lib/mysql
chown mysql:mysql /srv/var/lib/mysql

create system tables at mounted share:

mysql_install_db --datadir=/srv/var/lib/mysql

stop the service:

systemctl stop mysql.service

Configuration

Now we need to let MariaDB use the data directory. Edit /etc/mysql/mariadb.conf.d/50-server.cnf with your favourite editor, and change the following line:

datadir = /srv/var/lib/mysql

TODO other db tweaks?

Save the change and quit the editor.

Start MariaDB again. Now it will use the new data directory.

systemctl start mysql.service

Securing the installation

Run:

mysql_secure_installation

It's pretty straightforward, though:

  • Current password for the root user is empty, so just enter when asked;
  • Setting the root password seems to have no influence when logging in as user root from localhost (you can always log in), but is important if you try to log in as root from another user.
  • As for the other questions, answer the default (= press enter) which is always 'Y'.
Clone this wiki locally