MariaDB 公式にあるように、Debian 9 から MariaDB 10.1 がデフォルトの RDBMS になりました。
Moving from MySQL to MariaDB in Debian 9
今回は MariaDB Corporation(mariadb.com)のレポジトリから 10.4 をインストールします。
標準の MariaDB 10.1 を削除
標準の MariaDB 10.1 がインストールされているのであれば、削除しておきます。
apt-get remove mariadb*
MariaDB 公式レポジトリを登録
次に 10.4 レポジトリを登録します。
apt-get install software-properties-common dirmngr
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
/etc/apt/sources.list.d/mariadb.list がレポジトリが設定されます。異なるバージョンの MariaDB Server をインストールする場合は,バージョン番号(10.4)を変更します。
/etc/apt/sources.list.d/mariadb.list
# MariaDB Server
deb http://downloads.mariadb.com/MariaDB/mariadb-10.4/repo/debian stretch main
# MariaDB MaxScale
deb http://downloads.mariadb.com/MaxScale/2.3/debian stretch main
# MariaDB Tools
deb http://downloads.mariadb.com/Tools/debian stretch main
MariaDB 10.4 をインストール
apt-get update
apt-get install mariadb-server
systemctl で MariaDB サーバを起動します。
systemctl enable mariadb
systemctl start mariadb
root ユーザで MariaDB monitor(mariadbコマンド)を実行すると,MariaDB サーバに接続できました。
# mariadb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.4.8-MariaDB-1:10.4.8+maria~stretch-log mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>