LoginSignup
0
0

More than 1 year has passed since last update.

Rocky Linux 8.5 に MariaDB Community Server 10.6 をインストール

Last updated at Posted at 2022-01-01

CentOS 8 が 2021-12-31 で EOL(End of Life) となりました。

Rocky Linux 8 に MariaDB Community Server 最新版をインストールしてみます。

Rocky Linux 8.5 をダウンロード

https://rockylinux.org/download/ から x86_64 用 ブート可能イメージ( https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.5-x86_64-boot.iso )をダウンロードし,VMware 上でブートします。

yum レポジトリ設定

以下のワンライナーを実行し,yum レポジトリを設定します。

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

バージョン指定をしないと, バージョン 10.6 のレポジトリが設定されます。他のバージョンを利用する場合は mariadb_repo_setup のオプションで --mariadb-server-version でバージョン指定するか,mariadb.repo の baseurl の 10.6 を他のバージョン番号で置換します。

/etc/yum.repos.d/mariadb.repo
[mariadb-main]
name = MariaDB Server
baseurl = https://dlm.mariadb.com/repo/mariadb-server/10.6/yum/rhel/8/x86_64
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY
gpgcheck = 1
enabled = 1
module_hotfixes = 1

[mariadb-maxscale]
name = MariaDB MaxScale
baseurl = https://dlm.mariadb.com/repo/maxscale/latest/yum/rhel/8/x86_64
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY
gpgcheck = 1
enabled = 1

[mariadb-tools]
name = MariaDB Tools
baseurl = https://downloads.mariadb.com/Tools/rhel/8/x86_64
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Enterprise-GPG-KEY
gpgcheck = 1
enabled = 1

MariaDB Community Server 10.6 のインストール

今回は最新版の 10.6 をインストールしますので,そのまま MariaDB-server をインストールします。

dnf -y install MariaDB-server

MariaDB Monitor の実行

最近のバージョンの MariaDB では,mysql コマンドでなく,mariadb コマンドで MariaDB monitor を起動できます。

$ sudo mariadb
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.6.5-MariaDB MariaDB Server

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)]>

2022-01-01 時点で,10.6.5 がインストールされました。

なお,下方互換性のために,mysql コマンドは /usr/bin/mariadb へのシンボリックリンクとなっています。

$ ls -l /usr/bin/mysql
lrwxrwxrwx. 1 root root 7 Nov  6 06:41 /usr/bin/mysql -> mariadb
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0