Software Installation

Get the latest stable version directly from the project, instead of the older release in the Ubuntu software package repository, we add their own repository to your system.

Get the release signing keys:

$ curl --silent https://supplychain.mariadb.com/MariaDB-Server-GPG-KEY \
    | gpg --dearmor | \
    sudo tee /etc/apt/keyrings/MariaDB-Server.gpg > /dev/null

$ curl --silent https://supplychain.mariadb.com/MariaDB-MaxScale-GPG-KEY \
    | gpg --dearmor | \
    sudo tee /etc/apt/keyrings/MariaDB-MaxScale.gpg > /dev/null

$ curl --silent https://supplychain.mariadb.com/MariaDB-Enterprise-GPG-KEY \
    | gpg --dearmor | \
    sudo tee /etc/apt/keyrings/MariaDB-Enterprise.gpg > /dev/null

Create a source file:

/etc/apt/sources.list.d/mariadb.sources
 1# MariaDB Server
 2# To use a different major version of the server, or to pin to a specific minor
 3# version, change URI below.
 4Types: deb
 5URIs: https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/ubuntu
 6Suites: jammy
 7Components: main
 8Architectures: amd64 arm64
 9Signed-By: /etc/apt/keyrings/MariaDB-Server.gpg
10
11# MariaDB MaxScale
12# To use the latest stable release of MaxScale, use "latest" as the version
13# To use the latest beta (or stable if no current beta) release of MaxScale, use
14# "beta" as the version
15Types: deb
16URIs: https://dlm.mariadb.com/repo/maxscale/latest/apt
17Suites: jammy
18Components: main
19Architectures: amd64 arm64
20Signed-By: /etc/apt/keyrings/MariaDB-MaxScale.gpg
21
22# MariaDB Tools
23# MariaDB Tools are a collection of advanced command-line tools.
24Types: deb
25URIs: http://downloads.mariadb.com/Tools/ubuntu
26Suites: jammy
27Components: main
28Architectures: amd64
29Signed-By: /etc/apt/keyrings/MariaDB-Enterprise.gpg
30
31# -*- mode: debsources; indent-tabs-mode: nil; tab-width: 4; -*-

Create a preferences file to give the packages from the MariaDB repositories the highest priority, in order to avoid conflicts with packages from OS and other repositories:

/etc/apt/preferences.d/mariadb.pref
1Package: *
2Pin: origin dlm.mariadb.com
3Pin-Priority: 1000

Update the software repository cache:

$ sudo apt update

Once key and repository have been added and the package database updated, it can be installed as follows:

$ sudo apt install mariadb-server

Note

If Oracle MySQL server is already installed, it will be removed, but not without confirmation. MySQL configuration files will be preserved and used by MariaDB.

MariaDB runs as Systemd service mariadb.service. It’s not started after Installation:

$ systemctl status mariadb.service
○ mariadb.service - MariaDB 10.10.2 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
            └─migrated-from-my.cnf-settings.conf
    Active: inactive (dead)
    Docs: man:mariadbd(8)
            https://mariadb.com/kb/en/library/systemd/

We therefore can begin with its extensive configuration task.