【CentOS stream 9】 Maria DBをインストール

2022年6月13日

ConoHaのVPSのCentOS stream 9に Maria DB 10.5をインストールします。

関連記事 Apache系インストール
1.ConoHa VPS のSSHセキュリティを強化する
2.【CentOS stream 9】 Apacheをインストールする
3.【CentOS stream 9】 Maria DBをインストールする
4.【CentOS stream 9】 phpをインストールする
5.【CentOS stream 9】 composerをインストールする
関連記事 Nginx系インストール
1.ConoHa VPS のSSHセキュリティを強化する
2.【CentOS stream 9】 Nginxをインストールする
3.【CentOS stream 9】 Maria DBをインストールする
4.【CentOS stream 9】 phpをインストールする
5.【CentOS stream 9】 Nginxでphp、phpMyAdminを使う
6.【CentOS stream 9】 composerをインストールする
7.【CentOS stream 9】 Nginxに let's encrypt SSL証明書インストール
関連記事 ドメイン
ConoHa WING VPS に サブドメインを追加する

Maria DBのインストール手順

dnf infoコマンドでmariadb-serverの情報確認

# dnf info mariadb-server
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:19:41 ago on Wed 01 Jun 2022 11:55:29 PM JST.
Available Packages
Name         : mariadb-server
Epoch        : 3
Version      : 10.5.13
Release      : 2.el9
Architecture : x86_64
Size         : 9.4 M
Source       : mariadb-10.5.13-2.el9.src.rpm
Repository   : appstream
Summary      : The MariaDB server and related files
URL          : http://mariadb.org
License      : GPLv2 and LGPLv2
Description  : MariaDB is a multi-user, multi-threaded SQL database server. It
             : is a client/server implementation consisting of a server daemon
             : (mariadbd) and many different client programs and libraries. This
             : package contains the MariaDB server and some accompanying files
             : and directories. MariaDB is a community developed fork from
             : MySQL.

dnf install コマンドで mariadb-serverをインストール

# dnf install mariadb-server
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:21:22 ago on Wed 01 Jun 2022 11:55:29 PM JST.
Dependencies resolved.
================================================================================
 Package                       Arch    Version                 Repository  Size
================================================================================
Installing:
 mariadb-server                x86_64  3:10.5.13-2.el9         appstream  9.4 M
Installing dependencies:
 mariadb                       x86_64  3:10.5.13-2.el9         appstream  1.6 M
 mariadb-common                x86_64  3:10.5.13-2.el9         appstream   35 k
 mariadb-connector-c           x86_64  3.1.13-3.el9            appstream  198 k
 mariadb-connector-c-config    noarch  3.1.13-3.el9            appstream   11 k
 mariadb-errmsg                x86_64  3:10.5.13-2.el9         appstream  195 k
 mysql-selinux                 noarch  1.0.4-2.el9             appstream   36 k
 perl-AutoLoader               noarch  5.74-479.el9            appstream   31 k
 perl-B                        x86_64  1.80-479.el9            appstream  190 k
 perl-Carp                     noarch  1.50-460.el9            appstream   30 k
 perl-Class-Struct             noarch  0.66-479.el9            appstream   32 k
 perl-DBD-MariaDB              x86_64  1.21-15.el9             appstream  152 k
 perl-DBI                      x86_64  1.643-9.el9             appstream  725 k
 perl-Data-Dumper              x86_64  2.174-462.el9           appstream   56 k
 perl-Digest                   noarch  1.19-4.el9              appstream   26 k
 perl-Digest-MD5               x86_64  2.58-4.el9              appstream   37 k
 perl-DynaLoader               x86_64  1.47-479.el9            appstream   35 k
 perl-Encode                   x86_64  4:3.08-462.el9          appstream  1.7 M
 perl-Errno                    x86_64  1.30-479.el9            appstream   24 k
 perl-Exporter                 noarch  5.74-461.el9            appstream   32 k
 perl-Fcntl                    x86_64  1.13-479.el9            appstream   30 k
 perl-File-Basename            noarch  2.85-479.el9            appstream   27 k
 perl-File-Copy                noarch  2.34-479.el9            appstream   30 k
 perl-File-Path                noarch  2.18-4.el9              appstream   36 k
 perl-File-Temp                noarch  1:0.231.100-4.el9       appstream   60 k
 perl-File-stat                noarch  1.09-479.el9            appstream   27 k
 perl-FileHandle               noarch  2.03-479.el9            appstream   25 k
 perl-Getopt-Long              noarch  1:2.52-4.el9            appstream   61 k
 perl-Getopt-Std               noarch  1.12-479.el9            appstream   25 k
 perl-HTTP-Tiny                noarch  0.076-460.el9           appstream   55 k
 perl-IO                       x86_64  1.43-479.el9            appstream   98 k
 perl-IO-Socket-IP             noarch  0.41-5.el9              appstream   43 k
 perl-IPC-Open3                noarch  1.21-479.el9            appstream   32 k
 perl-MIME-Base64              x86_64  3.16-4.el9              appstream   31 k
 perl-Math-BigInt              noarch  1:1.9998.18-460.el9     appstream  190 k
 perl-Math-Complex             noarch  1.59-479.el9            appstream   56 k
 perl-Net-SSLeay               x86_64  1.92-1.el9              appstream  388 k
 perl-POSIX                    x86_64  1.94-479.el9            appstream  106 k
 perl-PathTools                x86_64  3.78-461.el9            appstream   88 k
 perl-Pod-Escapes              noarch  1:1.07-460.el9          appstream   21 k
 perl-Pod-Perldoc              noarch  3.28.01-461.el9         appstream   87 k
 perl-Pod-Simple               noarch  1:3.42-4.el9            appstream  225 k
 perl-Pod-Usage                noarch  4:2.01-4.el9            appstream   41 k
 perl-Scalar-List-Utils        x86_64  4:1.56-461.el9          appstream   73 k
 perl-SelectSaver              noarch  1.02-479.el9            appstream   21 k
 perl-Socket                   x86_64  4:2.031-4.el9           appstream   56 k
 perl-Storable                 x86_64  1:3.21-460.el9          appstream   96 k
 perl-Symbol                   noarch  1.08-479.el9            appstream   24 k
 perl-Sys-Hostname             x86_64  1.23-479.el9            appstream   27 k
 perl-Term-ANSIColor           noarch  5.01-461.el9            appstream   49 k
 perl-Term-Cap                 noarch  1.17-460.el9            appstream   23 k
 perl-Text-ParseWords          noarch  3.30-460.el9            appstream   17 k
 perl-Text-Tabs+Wrap           noarch  2013.0523-460.el9       appstream   24 k
 perl-Time-Local               noarch  2:1.300-7.el9           appstream   34 k
 perl-URI                      noarch  5.09-3.el9              appstream  121 k
 perl-base                     noarch  2.27-479.el9            appstream   26 k
 perl-constant                 noarch  1.33-461.el9            appstream   24 k
 perl-if                       noarch  0.60.800-479.el9        appstream   24 k
 perl-interpreter              x86_64  4:5.32.1-479.el9        appstream   81 k
 perl-libnet                   noarch  3.13-4.el9              appstream  130 k
 perl-libs                     x86_64  4:5.32.1-479.el9        appstream  2.2 M
 perl-mro                      x86_64  1.23-479.el9            appstream   38 k
 perl-overload                 noarch  1.31-479.el9            appstream   55 k
 perl-overloading              noarch  0.02-479.el9            appstream   22 k
 perl-parent                   noarch  1:0.238-460.el9         appstream   15 k
 perl-podlators                noarch  1:4.14-460.el9          appstream  114 k
 perl-subs                     noarch  1.03-479.el9            appstream   21 k
 perl-vars                     noarch  1.05-479.el9            appstream   23 k
 policycoreutils-python-utils  noarch  3.3-2.el9               appstream   77 k
Installing weak dependencies:
 mariadb-backup                x86_64  3:10.5.13-2.el9         appstream  6.4 M
 mariadb-gssapi-server         x86_64  3:10.5.13-2.el9         appstream   21 k
 mariadb-server-utils          x86_64  3:10.5.13-2.el9         appstream  215 k
 perl-IO-Socket-SSL            noarch  2.073-1.el9             appstream  219 k
 perl-Mozilla-CA               noarch  20200520-6.el9          appstream   13 k
 perl-NDBM_File                x86_64  1.15-479.el9            appstream   32 k

Transaction Summary
================================================================================
Install  75 Packages

Total download size: 26 M
Installed size: 135 M
Is this ok [y/N]:y

最後に「y」を入力してエンター

Downloading Packages:
(1/75): mariadb-common-10.5.13-2.el9.x86_64.rpm 972 kB/s |  35 kB     00:00
(2/75): mariadb-connector-c-3.1.13-3.el9.x86_64  11 MB/s | 198 kB     00:00
(3/75): mariadb-connector-c-config-3.1.13-3.el9 2.0 MB/s |  11 kB     00:00
(4/75): mariadb-errmsg-10.5.13-2.el9.x86_64.rpm  14 MB/s | 195 kB     00:00
(5/75): mariadb-gssapi-server-10.5.13-2.el9.x86 4.2 MB/s |  21 kB     00:00
(6/75): mariadb-10.5.13-2.el9.x86_64.rpm         11 MB/s | 1.6 MB     00:00
(7/75): mariadb-server-utils-10.5.13-2.el9.x86_  13 MB/s | 215 kB     00:00
(8/75): mysql-selinux-1.0.4-2.el9.noarch.rpm    3.9 MB/s |  36 kB     00:00
(9/75): perl-AutoLoader-5.74-479.el9.noarch.rpm 5.5 MB/s |  31 kB     00:00
(10/75): perl-B-1.80-479.el9.x86_64.rpm         9.8 MB/s | 190 kB     00:00
(11/75): perl-Carp-1.50-460.el9.noarch.rpm      3.2 MB/s |  30 kB     00:00
(12/75): perl-Class-Struct-0.66-479.el9.noarch. 5.9 MB/s |  32 kB     00:00
(13/75): perl-DBD-MariaDB-1.21-15.el9.x86_64.rp  14 MB/s | 152 kB     00:00
(14/75): perl-DBI-1.643-9.el9.x86_64.rpm         13 MB/s | 725 kB     00:00
(15/75): perl-Data-Dumper-2.174-462.el9.x86_64. 7.9 MB/s |  56 kB     00:00
(16/75): perl-Digest-1.19-4.el9.noarch.rpm      4.8 MB/s |  26 kB     00:00
(17/75): perl-Digest-MD5-2.58-4.el9.x86_64.rpm  6.0 MB/s |  37 kB     00:00
(18/75): perl-DynaLoader-1.47-479.el9.x86_64.rp 4.5 MB/s |  35 kB     00:00
(19/75): mariadb-backup-10.5.13-2.el9.x86_64.rp  17 MB/s | 6.4 MB     00:00
(20/75): perl-Errno-1.30-479.el9.x86_64.rpm     2.5 MB/s |  24 kB     00:00
(21/75): perl-Exporter-5.74-461.el9.noarch.rpm  2.0 MB/s |  32 kB     00:00
(22/75): perl-Encode-3.08-462.el9.x86_64.rpm     14 MB/s | 1.7 MB     00:00
(23/75): perl-Fcntl-1.13-479.el9.x86_64.rpm     879 kB/s |  30 kB     00:00
(24/75): perl-File-Basename-2.85-479.el9.noarch 3.2 MB/s |  27 kB     00:00
(25/75): perl-File-Path-2.18-4.el9.noarch.rpm   5.9 MB/s |  36 kB     00:00
(26/75): perl-File-Copy-2.34-479.el9.noarch.rpm 1.9 MB/s |  30 kB     00:00
(27/75): perl-File-Temp-0.231.100-4.el9.noarch. 5.0 MB/s |  60 kB     00:00
(28/75): perl-File-stat-1.09-479.el9.noarch.rpm 2.5 MB/s |  27 kB     00:00
(29/75): perl-FileHandle-2.03-479.el9.noarch.rp 2.6 MB/s |  25 kB     00:00
(30/75): perl-Getopt-Std-1.12-479.el9.noarch.rp 4.2 MB/s |  25 kB     00:00
(31/75): perl-Getopt-Long-2.52-4.el9.noarch.rpm 2.8 MB/s |  61 kB     00:00
(32/75): perl-HTTP-Tiny-0.076-460.el9.noarch.rp 4.2 MB/s |  55 kB     00:00
(33/75): perl-IO-Socket-IP-0.41-5.el9.noarch.rp 6.0 MB/s |  43 kB     00:00
(34/75): perl-IO-Socket-SSL-2.073-1.el9.noarch.  12 MB/s | 219 kB     00:00
(35/75): perl-IO-1.43-479.el9.x86_64.rpm        2.5 MB/s |  98 kB     00:00
(36/75): perl-IPC-Open3-1.21-479.el9.noarch.rpm 4.6 MB/s |  32 kB     00:00
(37/75): perl-MIME-Base64-3.16-4.el9.x86_64.rpm 2.4 MB/s |  31 kB     00:00
(38/75): perl-Math-BigInt-1.9998.18-460.el9.noa  10 MB/s | 190 kB     00:00
(39/75): perl-Mozilla-CA-20200520-6.el9.noarch. 3.1 MB/s |  13 kB     00:00
(40/75): perl-Math-Complex-1.59-479.el9.noarch. 2.7 MB/s |  56 kB     00:00
(41/75): perl-NDBM_File-1.15-479.el9.x86_64.rpm 3.2 MB/s |  32 kB     00:00
(42/75): perl-Net-SSLeay-1.92-1.el9.x86_64.rpm   20 MB/s | 388 kB     00:00
(43/75): mariadb-server-10.5.13-2.el9.x86_64.rp  17 MB/s | 9.4 MB     00:00
(44/75): perl-POSIX-1.94-479.el9.x86_64.rpm     1.5 MB/s | 106 kB     00:00
(45/75): perl-PathTools-3.78-461.el9.x86_64.rpm 1.6 MB/s |  88 kB     00:00
(46/75): perl-Pod-Escapes-1.07-460.el9.noarch.r 1.9 MB/s |  21 kB     00:00
(47/75): perl-Pod-Simple-3.42-4.el9.noarch.rpm   19 MB/s | 225 kB     00:00
(48/75): perl-Pod-Usage-2.01-4.el9.noarch.rpm   3.2 MB/s |  41 kB     00:00
(49/75): perl-Scalar-List-Utils-1.56-461.el9.x8 9.9 MB/s |  73 kB     00:00
(50/75): perl-Pod-Perldoc-3.28.01-461.el9.noarc 3.1 MB/s |  87 kB     00:00
(51/75): perl-SelectSaver-1.02-479.el9.noarch.r 2.1 MB/s |  21 kB     00:00
(52/75): perl-Socket-2.031-4.el9.x86_64.rpm     5.2 MB/s |  56 kB     00:00
(53/75): perl-Symbol-1.08-479.el9.noarch.rpm    2.6 MB/s |  24 kB     00:00
(54/75): perl-Sys-Hostname-1.23-479.el9.x86_64. 3.0 MB/s |  27 kB     00:00
(55/75): perl-Term-ANSIColor-5.01-461.el9.noarc 6.1 MB/s |  49 kB     00:00
(56/75): perl-Term-Cap-1.17-460.el9.noarch.rpm  2.6 MB/s |  23 kB     00:00
(57/75): perl-Storable-3.21-460.el9.x86_64.rpm  3.0 MB/s |  96 kB     00:00
(58/75): perl-Text-ParseWords-3.30-460.el9.noar 1.0 MB/s |  17 kB     00:00
(59/75): perl-Text-Tabs+Wrap-2013.0523-460.el9. 1.5 MB/s |  24 kB     00:00
(60/75): perl-Time-Local-1.300-7.el9.noarch.rpm 3.2 MB/s |  34 kB     00:00
(61/75): perl-constant-1.33-461.el9.noarch.rpm  4.0 MB/s |  24 kB     00:00
(62/75): perl-base-2.27-479.el9.noarch.rpm      1.9 MB/s |  26 kB     00:00
(63/75): perl-if-0.60.800-479.el9.noarch.rpm    3.0 MB/s |  24 kB     00:00
(64/75): perl-libnet-3.13-4.el9.noarch.rpm       16 MB/s | 130 kB     00:00
(65/75): perl-URI-5.09-3.el9.noarch.rpm         3.1 MB/s | 121 kB     00:00
(66/75): perl-interpreter-5.32.1-479.el9.x86_64 3.0 MB/s |  81 kB     00:00
(67/75): perl-mro-1.23-479.el9.x86_64.rpm       2.7 MB/s |  38 kB     00:00
(68/75): perl-overload-1.31-479.el9.noarch.rpm  3.2 MB/s |  55 kB     00:00
(69/75): perl-overloading-0.02-479.el9.noarch.r 1.9 MB/s |  22 kB     00:00
(70/75): perl-parent-0.238-460.el9.noarch.rpm   1.9 MB/s |  15 kB     00:00
(71/75): perl-subs-1.03-479.el9.noarch.rpm      1.3 MB/s |  21 kB     00:00
(72/75): perl-vars-1.05-479.el9.noarch.rpm      2.5 MB/s |  23 kB     00:00
(73/75): perl-podlators-4.14-460.el9.noarch.rpm 3.2 MB/s | 114 kB     00:00
(74/75): perl-libs-5.32.1-479.el9.x86_64.rpm     26 MB/s | 2.2 MB     00:00
(75/75): policycoreutils-python-utils-3.3-2.el9 3.6 MB/s |  77 kB     00:00
--------------------------------------------------------------------------------
Total                                            23 MB/s |  26 MB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : mariadb-connector-c-config-3.1.13-3.el9.noarch        1/75
  Installing       : mariadb-common-3:10.5.13-2.el9.x86_64                 2/75
  Installing       : mariadb-connector-c-3.1.13-3.el9.x86_64               3/75
  Installing       : mariadb-errmsg-3:10.5.13-2.el9.x86_64                 4/75
  Installing       : perl-Digest-1.19-4.el9.noarch                         5/75
  Installing       : perl-Digest-MD5-2.58-4.el9.x86_64                     6/75
  Installing       : perl-B-1.80-479.el9.x86_64                            7/75
  Installing       : perl-FileHandle-2.03-479.el9.noarch                   8/75
  Installing       : perl-Data-Dumper-2.174-462.el9.x86_64                 9/75
  Installing       : perl-libnet-3.13-4.el9.noarch                        10/75
  Installing       : perl-AutoLoader-5.74-479.el9.noarch                  11/75
  Installing       : perl-base-2.27-479.el9.noarch                        12/75
  Installing       : perl-URI-5.09-3.el9.noarch                           13/75
  Installing       : perl-Net-SSLeay-1.92-1.el9.x86_64                    14/75
  Installing       : perl-Mozilla-CA-20200520-6.el9.noarch                15/75
  Installing       : perl-if-0.60.800-479.el9.noarch                      16/75
  Installing       : perl-IO-Socket-IP-0.41-5.el9.noarch                  17/75
  Installing       : perl-Time-Local-2:1.300-7.el9.noarch                 18/75
  Installing       : perl-File-Path-2.18-4.el9.noarch                     19/75
  Installing       : perl-Pod-Escapes-1:1.07-460.el9.noarch               20/75
  Installing       : perl-Text-Tabs+Wrap-2013.0523-460.el9.noarch         21/75
  Installing       : perl-IO-Socket-SSL-2.073-1.el9.noarch                22/75
  Installing       : perl-Class-Struct-0.66-479.el9.noarch                23/75
  Installing       : perl-POSIX-1.94-479.el9.x86_64                       24/75
  Installing       : perl-Term-ANSIColor-5.01-461.el9.noarch              25/75
  Installing       : perl-IPC-Open3-1.21-479.el9.noarch                   26/75
  Installing       : perl-subs-1.03-479.el9.noarch                        27/75
  Installing       : perl-File-Temp-1:0.231.100-4.el9.noarch              28/75
  Installing       : perl-Term-Cap-1.17-460.el9.noarch                    29/75
  Installing       : perl-Pod-Simple-1:3.42-4.el9.noarch                  30/75
  Installing       : perl-HTTP-Tiny-0.076-460.el9.noarch                  31/75
  Installing       : perl-Socket-4:2.031-4.el9.x86_64                     32/75
  Installing       : perl-SelectSaver-1.02-479.el9.noarch                 33/75
  Installing       : perl-Symbol-1.08-479.el9.noarch                      34/75
  Installing       : perl-File-stat-1.09-479.el9.noarch                   35/75
  Installing       : perl-podlators-1:4.14-460.el9.noarch                 36/75
  Installing       : perl-Pod-Perldoc-3.28.01-461.el9.noarch              37/75
  Installing       : perl-Fcntl-1.13-479.el9.x86_64                       38/75
  Installing       : perl-Text-ParseWords-3.30-460.el9.noarch             39/75
  Installing       : perl-mro-1.23-479.el9.x86_64                         40/75
  Installing       : perl-IO-1.43-479.el9.x86_64                          41/75
  Installing       : perl-overloading-0.02-479.el9.noarch                 42/75
  Installing       : perl-Pod-Usage-4:2.01-4.el9.noarch                   43/75
  Installing       : perl-Errno-1.30-479.el9.x86_64                       44/75
  Installing       : perl-File-Basename-2.85-479.el9.noarch               45/75
  Installing       : perl-Getopt-Std-1.12-479.el9.noarch                  46/75
  Installing       : perl-MIME-Base64-3.16-4.el9.x86_64                   47/75
  Installing       : perl-Scalar-List-Utils-4:1.56-461.el9.x86_64         48/75
  Installing       : perl-constant-1.33-461.el9.noarch                    49/75
  Installing       : perl-Storable-1:3.21-460.el9.x86_64                  50/75
  Installing       : perl-overload-1.31-479.el9.noarch                    51/75
  Installing       : perl-parent-1:0.238-460.el9.noarch                   52/75
  Installing       : perl-vars-1.05-479.el9.noarch                        53/75
  Installing       : perl-Getopt-Long-1:2.52-4.el9.noarch                 54/75
  Installing       : perl-Carp-1.50-460.el9.noarch                        55/75
  Installing       : perl-Exporter-5.74-461.el9.noarch                    56/75
  Installing       : perl-NDBM_File-1.15-479.el9.x86_64                   57/75
  Installing       : perl-PathTools-3.78-461.el9.x86_64                   58/75
  Installing       : perl-Encode-4:3.08-462.el9.x86_64                    59/75
  Installing       : perl-libs-4:5.32.1-479.el9.x86_64                    60/75
  Installing       : perl-interpreter-4:5.32.1-479.el9.x86_64             61/75
  Installing       : perl-DynaLoader-1.47-479.el9.x86_64                  62/75
  Installing       : perl-Sys-Hostname-1.23-479.el9.x86_64                63/75
  Installing       : perl-File-Copy-2.34-479.el9.noarch                   64/75
  Installing       : perl-Math-Complex-1.59-479.el9.noarch                65/75
  Installing       : perl-Math-BigInt-1:1.9998.18-460.el9.noarch          66/75
  Installing       : perl-DBI-1.643-9.el9.x86_64                          67/75
  Installing       : perl-DBD-MariaDB-1.21-15.el9.x86_64                  68/75
  Installing       : policycoreutils-python-utils-3.3-2.el9.noarch        69/75
  Running scriptlet: mysql-selinux-1.0.4-2.el9.noarch                     70/75
  Installing       : mysql-selinux-1.0.4-2.el9.noarch                     70/75
  Running scriptlet: mysql-selinux-1.0.4-2.el9.noarch                     70/75
libsemanage.semanage_direct_install_info: Overriding mysql module at lower priority 100 with module at priority 200.

  Installing       : mariadb-backup-3:10.5.13-2.el9.x86_64                71/75
  Installing       : mariadb-gssapi-server-3:10.5.13-2.el9.x86_64         72/75
  Installing       : mariadb-server-utils-3:10.5.13-2.el9.x86_64          73/75
  Running scriptlet: mariadb-server-3:10.5.13-2.el9.x86_64                74/75
  Installing       : mariadb-server-3:10.5.13-2.el9.x86_64                74/75
  Running scriptlet: mariadb-server-3:10.5.13-2.el9.x86_64                74/75
  Installing       : mariadb-3:10.5.13-2.el9.x86_64                       75/75
  Running scriptlet: mysql-selinux-1.0.4-2.el9.noarch                     75/75
  Running scriptlet: mariadb-3:10.5.13-2.el9.x86_64                       75/75
  Verifying        : mariadb-3:10.5.13-2.el9.x86_64                        1/75
  Verifying        : mariadb-backup-3:10.5.13-2.el9.x86_64                 2/75
  Verifying        : mariadb-common-3:10.5.13-2.el9.x86_64                 3/75
  Verifying        : mariadb-connector-c-3.1.13-3.el9.x86_64               4/75
  Verifying        : mariadb-connector-c-config-3.1.13-3.el9.noarch        5/75
  Verifying        : mariadb-errmsg-3:10.5.13-2.el9.x86_64                 6/75
  Verifying        : mariadb-gssapi-server-3:10.5.13-2.el9.x86_64          7/75
  Verifying        : mariadb-server-3:10.5.13-2.el9.x86_64                 8/75
  Verifying        : mariadb-server-utils-3:10.5.13-2.el9.x86_64           9/75
  Verifying        : mysql-selinux-1.0.4-2.el9.noarch                     10/75
  Verifying        : perl-AutoLoader-5.74-479.el9.noarch                  11/75
  Verifying        : perl-B-1.80-479.el9.x86_64                           12/75
  Verifying        : perl-Carp-1.50-460.el9.noarch                        13/75
  Verifying        : perl-Class-Struct-0.66-479.el9.noarch                14/75
  Verifying        : perl-DBD-MariaDB-1.21-15.el9.x86_64                  15/75
  Verifying        : perl-DBI-1.643-9.el9.x86_64                          16/75
  Verifying        : perl-Data-Dumper-2.174-462.el9.x86_64                17/75
  Verifying        : perl-Digest-1.19-4.el9.noarch                        18/75
  Verifying        : perl-Digest-MD5-2.58-4.el9.x86_64                    19/75
  Verifying        : perl-DynaLoader-1.47-479.el9.x86_64                  20/75
  Verifying        : perl-Encode-4:3.08-462.el9.x86_64                    21/75
  Verifying        : perl-Errno-1.30-479.el9.x86_64                       22/75
  Verifying        : perl-Exporter-5.74-461.el9.noarch                    23/75
  Verifying        : perl-Fcntl-1.13-479.el9.x86_64                       24/75
  Verifying        : perl-File-Basename-2.85-479.el9.noarch               25/75
  Verifying        : perl-File-Copy-2.34-479.el9.noarch                   26/75
  Verifying        : perl-File-Path-2.18-4.el9.noarch                     27/75
  Verifying        : perl-File-Temp-1:0.231.100-4.el9.noarch              28/75
  Verifying        : perl-File-stat-1.09-479.el9.noarch                   29/75
  Verifying        : perl-FileHandle-2.03-479.el9.noarch                  30/75
  Verifying        : perl-Getopt-Long-1:2.52-4.el9.noarch                 31/75
  Verifying        : perl-Getopt-Std-1.12-479.el9.noarch                  32/75
  Verifying        : perl-HTTP-Tiny-0.076-460.el9.noarch                  33/75
  Verifying        : perl-IO-1.43-479.el9.x86_64                          34/75
  Verifying        : perl-IO-Socket-IP-0.41-5.el9.noarch                  35/75
  Verifying        : perl-IO-Socket-SSL-2.073-1.el9.noarch                36/75
  Verifying        : perl-IPC-Open3-1.21-479.el9.noarch                   37/75
  Verifying        : perl-MIME-Base64-3.16-4.el9.x86_64                   38/75
  Verifying        : perl-Math-BigInt-1:1.9998.18-460.el9.noarch          39/75
  Verifying        : perl-Math-Complex-1.59-479.el9.noarch                40/75
  Verifying        : perl-Mozilla-CA-20200520-6.el9.noarch                41/75
  Verifying        : perl-NDBM_File-1.15-479.el9.x86_64                   42/75
  Verifying        : perl-Net-SSLeay-1.92-1.el9.x86_64                    43/75
  Verifying        : perl-POSIX-1.94-479.el9.x86_64                       44/75
  Verifying        : perl-PathTools-3.78-461.el9.x86_64                   45/75
  Verifying        : perl-Pod-Escapes-1:1.07-460.el9.noarch               46/75
  Verifying        : perl-Pod-Perldoc-3.28.01-461.el9.noarch              47/75
  Verifying        : perl-Pod-Simple-1:3.42-4.el9.noarch                  48/75
  Verifying        : perl-Pod-Usage-4:2.01-4.el9.noarch                   49/75
  Verifying        : perl-Scalar-List-Utils-4:1.56-461.el9.x86_64         50/75
  Verifying        : perl-SelectSaver-1.02-479.el9.noarch                 51/75
  Verifying        : perl-Socket-4:2.031-4.el9.x86_64                     52/75
  Verifying        : perl-Storable-1:3.21-460.el9.x86_64                  53/75
  Verifying        : perl-Symbol-1.08-479.el9.noarch                      54/75
  Verifying        : perl-Sys-Hostname-1.23-479.el9.x86_64                55/75
  Verifying        : perl-Term-ANSIColor-5.01-461.el9.noarch              56/75
  Verifying        : perl-Term-Cap-1.17-460.el9.noarch                    57/75
  Verifying        : perl-Text-ParseWords-3.30-460.el9.noarch             58/75
  Verifying        : perl-Text-Tabs+Wrap-2013.0523-460.el9.noarch         59/75
  Verifying        : perl-Time-Local-2:1.300-7.el9.noarch                 60/75
  Verifying        : perl-URI-5.09-3.el9.noarch                           61/75
  Verifying        : perl-base-2.27-479.el9.noarch                        62/75
  Verifying        : perl-constant-1.33-461.el9.noarch                    63/75
  Verifying        : perl-if-0.60.800-479.el9.noarch                      64/75
  Verifying        : perl-interpreter-4:5.32.1-479.el9.x86_64             65/75
  Verifying        : perl-libnet-3.13-4.el9.noarch                        66/75
  Verifying        : perl-libs-4:5.32.1-479.el9.x86_64                    67/75
  Verifying        : perl-mro-1.23-479.el9.x86_64                         68/75
  Verifying        : perl-overload-1.31-479.el9.noarch                    69/75
  Verifying        : perl-overloading-0.02-479.el9.noarch                 70/75
  Verifying        : perl-parent-1:0.238-460.el9.noarch                   71/75
  Verifying        : perl-podlators-1:4.14-460.el9.noarch                 72/75
  Verifying        : perl-subs-1.03-479.el9.noarch                        73/75
  Verifying        : perl-vars-1.05-479.el9.noarch                        74/75
  Verifying        : policycoreutils-python-utils-3.3-2.el9.noarch        75/75
Installed products updated.

Installed:
  mariadb-3:10.5.13-2.el9.x86_64
  mariadb-backup-3:10.5.13-2.el9.x86_64
  mariadb-common-3:10.5.13-2.el9.x86_64
  mariadb-connector-c-3.1.13-3.el9.x86_64
  mariadb-connector-c-config-3.1.13-3.el9.noarch
  mariadb-errmsg-3:10.5.13-2.el9.x86_64
  mariadb-gssapi-server-3:10.5.13-2.el9.x86_64
  mariadb-server-3:10.5.13-2.el9.x86_64
  mariadb-server-utils-3:10.5.13-2.el9.x86_64
  mysql-selinux-1.0.4-2.el9.noarch
  perl-AutoLoader-5.74-479.el9.noarch
  perl-B-1.80-479.el9.x86_64
  perl-Carp-1.50-460.el9.noarch
  perl-Class-Struct-0.66-479.el9.noarch
  perl-DBD-MariaDB-1.21-15.el9.x86_64
  perl-DBI-1.643-9.el9.x86_64
  perl-Data-Dumper-2.174-462.el9.x86_64
  perl-Digest-1.19-4.el9.noarch
  perl-Digest-MD5-2.58-4.el9.x86_64
  perl-DynaLoader-1.47-479.el9.x86_64
  perl-Encode-4:3.08-462.el9.x86_64
  perl-Errno-1.30-479.el9.x86_64
  perl-Exporter-5.74-461.el9.noarch
  perl-Fcntl-1.13-479.el9.x86_64
  perl-File-Basename-2.85-479.el9.noarch
  perl-File-Copy-2.34-479.el9.noarch
  perl-File-Path-2.18-4.el9.noarch
  perl-File-Temp-1:0.231.100-4.el9.noarch
  perl-File-stat-1.09-479.el9.noarch
  perl-FileHandle-2.03-479.el9.noarch
  perl-Getopt-Long-1:2.52-4.el9.noarch
  perl-Getopt-Std-1.12-479.el9.noarch
  perl-HTTP-Tiny-0.076-460.el9.noarch
  perl-IO-1.43-479.el9.x86_64
  perl-IO-Socket-IP-0.41-5.el9.noarch
  perl-IO-Socket-SSL-2.073-1.el9.noarch
  perl-IPC-Open3-1.21-479.el9.noarch
  perl-MIME-Base64-3.16-4.el9.x86_64
  perl-Math-BigInt-1:1.9998.18-460.el9.noarch
  perl-Math-Complex-1.59-479.el9.noarch
  perl-Mozilla-CA-20200520-6.el9.noarch
  perl-NDBM_File-1.15-479.el9.x86_64
  perl-Net-SSLeay-1.92-1.el9.x86_64
  perl-POSIX-1.94-479.el9.x86_64
  perl-PathTools-3.78-461.el9.x86_64
  perl-Pod-Escapes-1:1.07-460.el9.noarch
  perl-Pod-Perldoc-3.28.01-461.el9.noarch
  perl-Pod-Simple-1:3.42-4.el9.noarch
  perl-Pod-Usage-4:2.01-4.el9.noarch
  perl-Scalar-List-Utils-4:1.56-461.el9.x86_64
  perl-SelectSaver-1.02-479.el9.noarch
  perl-Socket-4:2.031-4.el9.x86_64
  perl-Storable-1:3.21-460.el9.x86_64
  perl-Symbol-1.08-479.el9.noarch
  perl-Sys-Hostname-1.23-479.el9.x86_64
  perl-Term-ANSIColor-5.01-461.el9.noarch
  perl-Term-Cap-1.17-460.el9.noarch
  perl-Text-ParseWords-3.30-460.el9.noarch
  perl-Text-Tabs+Wrap-2013.0523-460.el9.noarch
  perl-Time-Local-2:1.300-7.el9.noarch
  perl-URI-5.09-3.el9.noarch
  perl-base-2.27-479.el9.noarch
  perl-constant-1.33-461.el9.noarch
  perl-if-0.60.800-479.el9.noarch
  perl-interpreter-4:5.32.1-479.el9.x86_64
  perl-libnet-3.13-4.el9.noarch
  perl-libs-4:5.32.1-479.el9.x86_64
  perl-mro-1.23-479.el9.x86_64
  perl-overload-1.31-479.el9.noarch
  perl-overloading-0.02-479.el9.noarch
  perl-parent-1:0.238-460.el9.noarch
  perl-podlators-1:4.14-460.el9.noarch
  perl-subs-1.03-479.el9.noarch
  perl-vars-1.05-479.el9.noarch
  policycoreutils-python-utils-3.3-2.el9.noarch

Complete!

最後に「Complete!」と表示されます

MariaDBの自動起動設定

MariaDBの自動起動設定

# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.

MariaDBの起動

# systemctl start mariadb

MariaDBの状態確認

systemctl statusコマンドで状態確認

#  systemctl status mariadb
 mariadb.service - MariaDB 10.5 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor p>
     Active: active (running) since Sun 2022-05-22 05:25:07 JST; 55s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 29274 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited,>
    Process: 29296 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.ser>
    Process: 29388 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exite>
   Main PID: 29376 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 11 (limit: 2702)
     Memory: 67.3M
        CPU: 574ms
     CGroup: /system.slice/mariadb.service
             └─29376 /usr/libexec/mariadbd --basedir=/usr

May 22 05:25:07   mariadb-prepare-db-dir[29335]: See the MariaDB K>
May 22 05:25:07   mariadb-prepare-db-dir[29335]: MySQL manual for >
May 22 05:25:07   mariadb-prepare-db-dir[29335]: Please report any>
May 22 05:25:07   mariadb-prepare-db-dir[29335]: The latest inform>
May 22 05:25:07   mariadb-prepare-db-dir[29335]: You can find addi>
May 22 05:25:07   mariadb-prepare-db-dir[29335]: https://dev.mysql>
May 22 05:25:07   mariadb-prepare-db-dir[29335]: Consider joining >
May 22 05:25:07   mariadb-prepare-db-dir[29335]: https://mariadb.o>

MariaDBの初期設定

基本的には全て「y」と入力して、rootのパスワードを求められたときにパスワードを設定する

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):エンター
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password:パスワード入力
Re-enter new password:パスワード入力
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y  //nにすると誰でもログインが出来るようになる
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y // nにするとリモートでrootログインが出来るようになる
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y //テストのデータベースを削除する
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y //ここまでの設定をすぐに反映する
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

最後に「Thanks for using MariaDB!」と表示される

MariaDBにログイン

設定したパスワードでMariaDBにログインしてみる

# mysql -u root -p
Enter password:⇦パスワード入力
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 22
Server version: 10.5.13-MariaDB MariaDB Server //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)]>

プロンプトが「MariaDB [(none)]>」になればOK

データベースの確認

show databasesコマンドでデータベースの確認

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.002 sec)

MariaDBからログアウト

exitコマンドでログアウト

MariaDB [(none)]> exit
Bye
#
次やること
4.【CentOS stream 9】 phpをインストールする

参考サイト

WordPressに必要なソフトウェアをインストールしよう(MariaDB編)|ConoHa VPSサポート

phpMyAdminを使ってみよう|ConoHa VPSサポート

【 dnf 】コマンド(基礎編)――ソフトウェア(パッケージ)をインストールする

CentOS Stream 9 : MariaDB 10.5 : インストール : Server World

CentOS Stream 9にPostgreSQL13 をインストールする – 最新IT技術情報_arkgame.com

CentOS Stream 9 にDNF で MySQL を公式からインストール | 株式会社オルタ