AWS の EC2 Graviton2 インスタンスに MySQL をインストールしてみた（だけ）

これは **[MySQL Advent Calendar 2020](https://qiita.com/advent-calendar/2020/mysql)** 17 日目のエントリです（後から穴埋め）。

AWS では今年、EC2・RDS に 64-bit Arm ベースの Graviton2 プロセッサを採用したインスタンスを立てられるようになりましたので、EC2 の r6g.large インスタンス（2vCPU・メモリ 16GiB）に MySQL Server 8.0.22 をインストールしてみました。

※本当に**インストールしただけ**です（続きは後日）。

# EC2 インスタンス起動

まずは 64-bit Arm 向けの CentOS 8.3（あえて Stream ではない）を選んで、
![r6g1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/123899/8a58c3a6-2c23-e910-471b-a1da73762921.png)
r6g.large インスタンスを選択して…
![r6g2.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/123899/3470fc40-88f7-438b-bdbc-fe808191eeb9.png)
ストレージは gp3 を選んでインスタンスを立ててみました。
![r6g3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/123899/28af63c9-4fad-5533-1de0-20084e34d5dd.png)

# MySQL Community Server 8.0.22 インストール

x86_64 系プロセッサを使う場合とほぼ同様に MySQL Community Server 8.0.22 をインストールしていきます。

※適宜、言語・ロケールなどの設定を行ってください（ここでは省略）。

```bash:まずはwgetを入れる
$ sudo dnf install wget
Last metadata expiration check: 0:01:08 ago on Fri 18 Dec 2020 12:56:37 PM UTC.
Dependencies resolved.
================================================================================
 Package       Architecture     Version                Repository          Size
================================================================================
Installing:
 wget          aarch64          1.19.5-10.el8          appstream          716 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 716 k
Installed size: 2.8 M
Is this ok [y/N]: y
Downloading Packages:
wget-1.19.5-10.el8.aarch64.rpm                  1.0 MB/s | 716 kB     00:00
--------------------------------------------------------------------------------
Total                                           608 kB/s | 716 kB     00:01
warning: /var/cache/dnf/appstream-ad81255f8cddaa99/packages/wget-1.19.5-10.el8.aarch64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
CentOS Linux 8 - AppStream                      1.6 MB/s | 1.6 kB     00:00
Importing GPG key 0x8483C65D:
 Userid     : "CentOS (CentOS Official Signing Key) <security@centos.org>"
 Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : wget-1.19.5-10.el8.aarch64                             1/1
  Running scriptlet: wget-1.19.5-10.el8.aarch64                             1/1
  Verifying        : wget-1.19.5-10.el8.aarch64                             1/1

Installed:
  wget-1.19.5-10.el8.aarch64

Complete!
```

```bash:MySQLのリポジトリを追加
$ wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
--2020-12-18 12:57:54--  https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm [following]
--2020-12-18 12:57:55--  https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.45.57.22
Connecting to repo.mysql.com (repo.mysql.com)|23.45.57.22|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 30388 (30K) [application/x-redhat-package-manager]
Saving to: ‘mysql80-community-release-el8-1.noarch.rpm’

mysql80-community-r 100%[===================>]  29.68K  --.-KB/s    in 0.001s

2020-12-18 12:57:55 (32.6 MB/s) - ‘mysql80-community-release-el8-1.noarch.rpm’ saved [30388/30388]

$ sudo dnf localinstall mysql80-community-release-el8-1.noarch.rpm
Last metadata expiration check: 0:01:37 ago on Fri 18 Dec 2020 12:56:37 PM UTC.
Dependencies resolved.
================================================================================
 Package                        Arch        Version     Repository         Size
================================================================================
Installing:
 mysql80-community-release      noarch      el8-1       @commandline       30 k

Transaction Summary
================================================================================
Install  1 Package

Total size: 30 k
Installed size: 29 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : mysql80-community-release-el8-1.noarch                 1/1
  Verifying        : mysql80-community-release-el8-1.noarch                 1/1

Installed:
  mysql80-community-release-el8-1.noarch

Complete!
$ sudo dnf module disable mysql
MySQL 8.0 Community Server                      3.0 MB/s | 1.1 MB     00:00
MySQL Connectors Community                      127 kB/s |  43 kB     00:00
MySQL Tools Community                           246 kB/s |  79 kB     00:00
Dependencies resolved.
================================================================================
 Package           Architecture     Version             Repository         Size
================================================================================
Disabling modules:
 mysql

Transaction Summary
================================================================================

Is this ok [y/N]: y
Complete!
```

```bash:MySQLサーバをインストール
$ sudo dnf install mysql-community-server
Last metadata expiration check: 0:00:25 ago on Fri 18 Dec 2020 12:58:39 PM UTC.
Dependencies resolved.
================================================================================
 Package                   Arch    Version              Repository         Size
================================================================================
Installing:
 mysql-community-server    aarch64 8.0.22-1.el8         mysql80-community  60 M
Installing dependencies:
 libaio                    aarch64 0.3.112-1.el8        baseos             33 k
 mysql-community-client    aarch64 8.0.22-1.el8         mysql80-community  14 M
 mysql-community-client-plugins
                           aarch64 8.0.22-1.el8         mysql80-community 106 k
 mysql-community-common    aarch64 8.0.22-1.el8         mysql80-community 620 k
 mysql-community-libs      aarch64 8.0.22-1.el8         mysql80-community 1.4 M
 perl-Carp                 noarch  1.42-396.el8         baseos             30 k
 perl-Data-Dumper          aarch64 2.167-399.el8        baseos             57 k
 perl-Digest               noarch  1.17-395.el8         appstream          27 k
 perl-Digest-MD5           aarch64 2.55-396.el8         appstream          37 k
 perl-Encode               aarch64 4:2.97-3.el8         baseos            1.5 M
 perl-Errno                aarch64 1.28-416.el8         baseos             76 k
 perl-Exporter             noarch  5.72-396.el8         baseos             34 k
 perl-File-Path            noarch  2.15-2.el8           baseos             38 k
 perl-File-Temp            noarch  0.230.600-1.el8      baseos             63 k
 perl-Getopt-Long          noarch  1:2.50-4.el8         baseos             63 k
 perl-HTTP-Tiny            noarch  0.074-1.el8          baseos             58 k
 perl-IO                   aarch64 1.38-416.el8         baseos            141 k
 perl-MIME-Base64          aarch64 3.15-396.el8         baseos             31 k
 perl-Net-SSLeay           aarch64 1.88-1.module_el8.3.0+410+ff426aa3
                                                        appstream         372 k
 perl-PathTools            aarch64 3.74-1.el8           baseos             90 k
 perl-Pod-Escapes          noarch  1:1.07-395.el8       baseos             20 k
 perl-Pod-Perldoc          noarch  3.28-396.el8         baseos             86 k
 perl-Pod-Simple           noarch  1:3.35-395.el8       baseos            213 k
 perl-Pod-Usage            noarch  4:1.69-395.el8       baseos             34 k
 perl-Scalar-List-Utils    aarch64 3:1.49-2.el8         baseos             67 k
 perl-Socket               aarch64 4:2.027-3.el8        baseos             59 k
 perl-Storable             aarch64 1:3.11-3.el8         baseos             95 k
 perl-Term-ANSIColor       noarch  4.06-396.el8         baseos             46 k
 perl-Term-Cap             noarch  1.17-395.el8         baseos             23 k
 perl-Text-ParseWords      noarch  3.30-395.el8         baseos             18 k
 perl-Text-Tabs+Wrap       noarch  2013.0523-395.el8    baseos             24 k
 perl-Time-Local           noarch  1:1.280-1.el8        baseos             34 k
 perl-URI                  noarch  1.73-3.el8           appstream         116 k
 perl-Unicode-Normalize    aarch64 1.25-396.el8         baseos             78 k
 perl-constant             noarch  1.33-396.el8         baseos             25 k
 perl-interpreter          aarch64 4:5.26.3-416.el8     baseos            6.3 M
 perl-libnet               noarch  3.11-3.el8           appstream         121 k
 perl-libs                 aarch64 4:5.26.3-416.el8     baseos            1.5 M
 perl-macros               aarch64 4:5.26.3-416.el8     baseos             72 k
 perl-parent               noarch  1:0.237-1.el8        baseos             20 k
 perl-podlators            noarch  4.11-1.el8           baseos            118 k
 perl-threads              aarch64 1:2.21-2.el8         baseos             60 k
 perl-threads-shared       aarch64 1.58-2.el8           baseos             47 k
Installing weak dependencies:
 perl-IO-Socket-IP         noarch  0.39-5.el8           appstream          47 k
 perl-IO-Socket-SSL        noarch  2.066-4.module_el8.3.0+410+ff426aa3
                                                        appstream         298 k
 perl-Mozilla-CA           noarch  20160104-7.module_el8.3.0+416+dee7bcef
                                                        appstream          15 k
Enabling module streams:
 perl                              5.26
 perl-IO-Socket-SSL                2.066
 perl-libwww-perl                  6.34

Transaction Summary
================================================================================
Install  47 Packages

Total download size: 88 M
Installed size: 407 M
Is this ok [y/N]: y
Downloading Packages:
(1/47): perl-IO-Socket-IP-0.39-5.el8.noarch.rpm 229 kB/s |  47 kB     00:00
(2/47): perl-Digest-1.17-395.el8.noarch.rpm      78 kB/s |  27 kB     00:00
(3/47): perl-Digest-MD5-2.55-396.el8.aarch64.rp 104 kB/s |  37 kB     00:00
(4/47): perl-Mozilla-CA-20160104-7.module_el8.3 100 kB/s |  15 kB     00:00
(5/47): perl-IO-Socket-SSL-2.066-4.module_el8.3 527 kB/s | 298 kB     00:00
(6/47): perl-Net-SSLeay-1.88-1.module_el8.3.0+4 816 kB/s | 372 kB     00:00
(7/47): libaio-0.3.112-1.el8.aarch64.rpm        222 kB/s |  33 kB     00:00
(8/47): perl-URI-1.73-3.el8.noarch.rpm          243 kB/s | 116 kB     00:00
(9/47): perl-Data-Dumper-2.167-399.el8.aarch64. 400 kB/s |  57 kB     00:00
(10/47): perl-Carp-1.42-396.el8.noarch.rpm      131 kB/s |  30 kB     00:00
(11/47): perl-libnet-3.11-3.el8.noarch.rpm      206 kB/s | 121 kB     00:00
(12/47): perl-Exporter-5.72-396.el8.noarch.rpm  216 kB/s |  34 kB     00:00
(13/47): perl-Errno-1.28-416.el8.aarch64.rpm    158 kB/s |  76 kB     00:00
(14/47): perl-File-Path-2.15-2.el8.noarch.rpm   155 kB/s |  38 kB     00:00
(15/47): perl-File-Temp-0.230.600-1.el8.noarch. 177 kB/s |  63 kB     00:00
(16/47): perl-Encode-2.97-3.el8.aarch64.rpm     1.6 MB/s | 1.5 MB     00:00
(17/47): perl-Getopt-Long-2.50-4.el8.noarch.rpm 141 kB/s |  63 kB     00:00
(18/47): perl-HTTP-Tiny-0.074-1.el8.noarch.rpm  132 kB/s |  58 kB     00:00
(19/47): perl-IO-1.38-416.el8.aarch64.rpm       288 kB/s | 141 kB     00:00
(20/47): perl-MIME-Base64-3.15-396.el8.aarch64.  84 kB/s |  31 kB     00:00
(21/47): perl-Pod-Escapes-1.07-395.el8.noarch.r  80 kB/s |  20 kB     00:00
(22/47): perl-PathTools-3.74-1.el8.aarch64.rpm  189 kB/s |  90 kB     00:00
(23/47): perl-Pod-Usage-1.69-395.el8.noarch.rpm 246 kB/s |  34 kB     00:00
(24/47): perl-Pod-Perldoc-3.28-396.el8.noarch.r 166 kB/s |  86 kB     00:00
(25/47): perl-Pod-Simple-3.35-395.el8.noarch.rp 588 kB/s | 213 kB     00:00
(26/47): perl-Storable-3.11-3.el8.aarch64.rpm   245 kB/s |  95 kB     00:00
(27/47): perl-Scalar-List-Utils-1.49-2.el8.aarc 144 kB/s |  67 kB     00:00
(28/47): perl-Socket-2.027-3.el8.aarch64.rpm    130 kB/s |  59 kB     00:00
(29/47): perl-Term-ANSIColor-4.06-396.el8.noarc 137 kB/s |  46 kB     00:00
(30/47): perl-Text-ParseWords-3.30-395.el8.noar  52 kB/s |  18 kB     00:00
(31/47): perl-Term-Cap-1.17-395.el8.noarch.rpm   59 kB/s |  23 kB     00:00
(32/47): perl-Text-Tabs+Wrap-2013.0523-395.el8.  97 kB/s |  24 kB     00:00
(33/47): perl-Time-Local-1.280-1.el8.noarch.rpm 134 kB/s |  34 kB     00:00
(34/47): perl-Unicode-Normalize-1.25-396.el8.aa 293 kB/s |  78 kB     00:00
(35/47): perl-constant-1.33-396.el8.noarch.rpm   64 kB/s |  25 kB     00:00
(36/47): perl-macros-5.26.3-416.el8.aarch64.rpm 310 kB/s |  72 kB     00:00
(37/47): perl-parent-0.237-1.el8.noarch.rpm      77 kB/s |  20 kB     00:00
(38/47): perl-libs-5.26.3-416.el8.aarch64.rpm   1.6 MB/s | 1.5 MB     00:00
(39/47): perl-interpreter-5.26.3-416.el8.aarch6 5.6 MB/s | 6.3 MB     00:01
(40/47): perl-podlators-4.11-1.el8.noarch.rpm   303 kB/s | 118 kB     00:00
(41/47): perl-threads-2.21-2.el8.aarch64.rpm    132 kB/s |  60 kB     00:00
(42/47): perl-threads-shared-1.58-2.el8.aarch64 134 kB/s |  47 kB     00:00
(43/47): mysql-community-client-plugins-8.0.22-  88 kB/s | 106 kB     00:01
(44/47): mysql-community-common-8.0.22-1.el8.aa 451 kB/s | 620 kB     00:01
(45/47): mysql-community-client-8.0.22-1.el8.aa 5.2 MB/s |  14 MB     00:02
(46/47): mysql-community-libs-8.0.22-1.el8.aarc 914 kB/s | 1.4 MB     00:01
(47/47): mysql-community-server-8.0.22-1.el8.aa  10 MB/s |  60 MB     00:05
--------------------------------------------------------------------------------
Total                                           6.5 MB/s |  88 MB     00:13
warning: /var/cache/dnf/mysql80-community-4467c2595a927b0d/packages/mysql-community-client-8.0.22-1.el8.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
MySQL 8.0 Community Server                       27 MB/s |  27 kB     00:00
Importing GPG key 0x5072E1F5:
 Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
 Fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : perl-Exporter-5.72-396.el8.noarch                     1/47
  Installing       : perl-libs-4:5.26.3-416.el8.aarch64                    2/47
  Installing       : perl-Carp-1.42-396.el8.noarch                         3/47
  Installing       : perl-Scalar-List-Utils-3:1.49-2.el8.aarch64           4/47
  Installing       : perl-parent-1:0.237-1.el8.noarch                      5/47
  Installing       : perl-Text-ParseWords-3.30-395.el8.noarch              6/47
  Installing       : mysql-community-common-8.0.22-1.el8.aarch64           7/47
  Installing       : mysql-community-client-plugins-8.0.22-1.el8.aarch6    8/47
  Installing       : mysql-community-libs-8.0.22-1.el8.aarch64             9/47
  Running scriptlet: mysql-community-libs-8.0.22-1.el8.aarch64             9/47
  Installing       : mysql-community-client-8.0.22-1.el8.aarch64          10/47
  Installing       : perl-Term-ANSIColor-4.06-396.el8.noarch              11/47
  Installing       : perl-macros-4:5.26.3-416.el8.aarch64                 12/47
  Installing       : perl-Errno-1.28-416.el8.aarch64                      13/47
  Installing       : perl-Socket-4:2.027-3.el8.aarch64                    14/47
  Installing       : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch         15/47
  Installing       : perl-Unicode-Normalize-1.25-396.el8.aarch64          16/47
  Installing       : perl-File-Path-2.15-2.el8.noarch                     17/47
  Installing       : perl-IO-1.38-416.el8.aarch64                         18/47
  Installing       : perl-PathTools-3.74-1.el8.aarch64                    19/47
  Installing       : perl-constant-1.33-396.el8.noarch                    20/47
  Installing       : perl-threads-1:2.21-2.el8.aarch64                    21/47
  Installing       : perl-threads-shared-1.58-2.el8.aarch64               22/47
  Installing       : perl-interpreter-4:5.26.3-416.el8.aarch64            23/47
  Installing       : perl-MIME-Base64-3.15-396.el8.aarch64                24/47
  Installing       : perl-IO-Socket-IP-0.39-5.el8.noarch                  25/47
  Installing       : perl-Time-Local-1:1.280-1.el8.noarch                 26/47
  Installing       : perl-Digest-1.17-395.el8.noarch                      27/47
  Installing       : perl-Digest-MD5-2.55-396.el8.aarch64                 28/47
  Installing       : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3   29/47
  Installing       : perl-Data-Dumper-2.167-399.el8.aarch64               30/47
  Installing       : perl-File-Temp-0.230.600-1.el8.noarch                31/47
  Installing       : perl-Pod-Escapes-1:1.07-395.el8.noarch               32/47
  Installing       : perl-Storable-1:3.11-3.el8.aarch64                   33/47
  Installing       : perl-Term-Cap-1.17-395.el8.noarch                    34/47
  Installing       : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7   35/47
  Installing       : perl-Encode-4:2.97-3.el8.aarch64                     36/47
  Installing       : perl-Pod-Simple-1:3.35-395.el8.noarch                37/47
  Installing       : perl-Getopt-Long-1:2.50-4.el8.noarch                 38/47
  Installing       : perl-podlators-4.11-1.el8.noarch                     39/47
  Installing       : perl-Pod-Usage-4:1.69-395.el8.noarch                 40/47
  Installing       : perl-Pod-Perldoc-3.28-396.el8.noarch                 41/47
  Installing       : perl-HTTP-Tiny-0.074-1.el8.noarch                    42/47
  Installing       : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff42   43/47
  Installing       : perl-libnet-3.11-3.el8.noarch                        44/47
  Installing       : perl-URI-1.73-3.el8.noarch                           45/47
  Installing       : libaio-0.3.112-1.el8.aarch64                         46/47
  Running scriptlet: mysql-community-server-8.0.22-1.el8.aarch64          47/47
  Installing       : mysql-community-server-8.0.22-1.el8.aarch64          47/47
  Running scriptlet: mysql-community-server-8.0.22-1.el8.aarch64          47/47
  Verifying        : perl-Digest-1.17-395.el8.noarch                       1/47
  Verifying        : perl-Digest-MD5-2.55-396.el8.aarch64                  2/47
  Verifying        : perl-IO-Socket-IP-0.39-5.el8.noarch                   3/47
  Verifying        : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff42    4/47
  Verifying        : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7    5/47
  Verifying        : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3    6/47
  Verifying        : perl-URI-1.73-3.el8.noarch                            7/47
  Verifying        : perl-libnet-3.11-3.el8.noarch                         8/47
  Verifying        : libaio-0.3.112-1.el8.aarch64                          9/47
  Verifying        : perl-Carp-1.42-396.el8.noarch                        10/47
  Verifying        : perl-Data-Dumper-2.167-399.el8.aarch64               11/47
  Verifying        : perl-Encode-4:2.97-3.el8.aarch64                     12/47
  Verifying        : perl-Errno-1.28-416.el8.aarch64                      13/47
  Verifying        : perl-Exporter-5.72-396.el8.noarch                    14/47
  Verifying        : perl-File-Path-2.15-2.el8.noarch                     15/47
  Verifying        : perl-File-Temp-0.230.600-1.el8.noarch                16/47
  Verifying        : perl-Getopt-Long-1:2.50-4.el8.noarch                 17/47
  Verifying        : perl-HTTP-Tiny-0.074-1.el8.noarch                    18/47
  Verifying        : perl-IO-1.38-416.el8.aarch64                         19/47
  Verifying        : perl-MIME-Base64-3.15-396.el8.aarch64                20/47
  Verifying        : perl-PathTools-3.74-1.el8.aarch64                    21/47
  Verifying        : perl-Pod-Escapes-1:1.07-395.el8.noarch               22/47
  Verifying        : perl-Pod-Perldoc-3.28-396.el8.noarch                 23/47
  Verifying        : perl-Pod-Simple-1:3.35-395.el8.noarch                24/47
  Verifying        : perl-Pod-Usage-4:1.69-395.el8.noarch                 25/47
  Verifying        : perl-Scalar-List-Utils-3:1.49-2.el8.aarch64          26/47
  Verifying        : perl-Socket-4:2.027-3.el8.aarch64                    27/47
  Verifying        : perl-Storable-1:3.11-3.el8.aarch64                   28/47
  Verifying        : perl-Term-ANSIColor-4.06-396.el8.noarch              29/47
  Verifying        : perl-Term-Cap-1.17-395.el8.noarch                    30/47
  Verifying        : perl-Text-ParseWords-3.30-395.el8.noarch             31/47
  Verifying        : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch         32/47
  Verifying        : perl-Time-Local-1:1.280-1.el8.noarch                 33/47
  Verifying        : perl-Unicode-Normalize-1.25-396.el8.aarch64          34/47
  Verifying        : perl-constant-1.33-396.el8.noarch                    35/47
  Verifying        : perl-interpreter-4:5.26.3-416.el8.aarch64            36/47
  Verifying        : perl-libs-4:5.26.3-416.el8.aarch64                   37/47
  Verifying        : perl-macros-4:5.26.3-416.el8.aarch64                 38/47
  Verifying        : perl-parent-1:0.237-1.el8.noarch                     39/47
  Verifying        : perl-podlators-4.11-1.el8.noarch                     40/47
  Verifying        : perl-threads-1:2.21-2.el8.aarch64                    41/47
  Verifying        : perl-threads-shared-1.58-2.el8.aarch64               42/47
  Verifying        : mysql-community-client-8.0.22-1.el8.aarch64          43/47
  Verifying        : mysql-community-client-plugins-8.0.22-1.el8.aarch6   44/47
  Verifying        : mysql-community-common-8.0.22-1.el8.aarch64          45/47
  Verifying        : mysql-community-libs-8.0.22-1.el8.aarch64            46/47
  Verifying        : mysql-community-server-8.0.22-1.el8.aarch64          47/47

Installed:
  libaio-0.3.112-1.el8.aarch64
  mysql-community-client-8.0.22-1.el8.aarch64
  mysql-community-client-plugins-8.0.22-1.el8.aarch64
  mysql-community-common-8.0.22-1.el8.aarch64
  mysql-community-libs-8.0.22-1.el8.aarch64
  mysql-community-server-8.0.22-1.el8.aarch64
  perl-Carp-1.42-396.el8.noarch
  perl-Data-Dumper-2.167-399.el8.aarch64
  perl-Digest-1.17-395.el8.noarch
  perl-Digest-MD5-2.55-396.el8.aarch64
  perl-Encode-4:2.97-3.el8.aarch64
  perl-Errno-1.28-416.el8.aarch64
  perl-Exporter-5.72-396.el8.noarch
  perl-File-Path-2.15-2.el8.noarch
  perl-File-Temp-0.230.600-1.el8.noarch
  perl-Getopt-Long-1:2.50-4.el8.noarch
  perl-HTTP-Tiny-0.074-1.el8.noarch
  perl-IO-1.38-416.el8.aarch64
  perl-IO-Socket-IP-0.39-5.el8.noarch
  perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch
  perl-MIME-Base64-3.15-396.el8.aarch64
  perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch
  perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.aarch64
  perl-PathTools-3.74-1.el8.aarch64
  perl-Pod-Escapes-1:1.07-395.el8.noarch
  perl-Pod-Perldoc-3.28-396.el8.noarch
  perl-Pod-Simple-1:3.35-395.el8.noarch
  perl-Pod-Usage-4:1.69-395.el8.noarch
  perl-Scalar-List-Utils-3:1.49-2.el8.aarch64
  perl-Socket-4:2.027-3.el8.aarch64
  perl-Storable-1:3.11-3.el8.aarch64
  perl-Term-ANSIColor-4.06-396.el8.noarch
  perl-Term-Cap-1.17-395.el8.noarch
  perl-Text-ParseWords-3.30-395.el8.noarch
  perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch
  perl-Time-Local-1:1.280-1.el8.noarch
  perl-URI-1.73-3.el8.noarch
  perl-Unicode-Normalize-1.25-396.el8.aarch64
  perl-constant-1.33-396.el8.noarch
  perl-interpreter-4:5.26.3-416.el8.aarch64
  perl-libnet-3.11-3.el8.noarch
  perl-libs-4:5.26.3-416.el8.aarch64
  perl-macros-4:5.26.3-416.el8.aarch64
  perl-parent-1:0.237-1.el8.noarch
  perl-podlators-4.11-1.el8.noarch
  perl-threads-1:2.21-2.el8.aarch64
  perl-threads-shared-1.58-2.el8.aarch64

Complete!
```

# 起動・初期設定

```bash:MySQLサーバ起動・初期設定
$ sudo systemctl enable mysqld.service
$ sudo systemctl start mysqld.service
$ sudo fgrep assword /var/log/mysqld.log
2020-12-18T13:08:42.554021Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 【初期パスワード】
$ mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:（初期パスワードを入力）

The existing password for the user account root has expired. Please set a new password.

New password:（新しいパスワードを入力）

Re-enter new password:（同じパスワードを入力）
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Using existing password for root.

Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n

 ... skipping.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : y
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? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : y
Success.

All done!
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.22 MySQL Community Server - GPL

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select * from performance_schema.global_variables where variable_name in ("innodb_buffer_pool_size", "innodb_log_file_size", "innodb_flush_method");
+-------------------------+----------------+
| VARIABLE_NAME           | VARIABLE_VALUE |
+-------------------------+----------------+
| innodb_buffer_pool_size | 134217728      |
| innodb_flush_method     | fsync          |
| innodb_log_file_size    | 50331648       |
+-------------------------+----------------+
3 rows in set (0.00 sec)

mysql> quit
Bye
```

`innodb_dedicated_server=ON` で起動してみます（参考：**[MySQL 8.0 の innodb_dedicated_server について](https://www.s-style.co.jp/blog/2018/08/2281/)**）。


```bash:innodb_dedicated_server=ONで起動
$ sudo systemctl stop mysqld.service
$ vi /etc/my.cnf
※末尾に「innodb_dedicated_server=ON」を追記して保存
$ systemctl start mysqld.service
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.22 MySQL Community Server - GPL

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select * from performance_schema.global_variables where variable_name in ("innodb_buffer_pool_size", "innodb_log_file_size", "innodb_flush_method");
+-------------------------+-------------------+
| VARIABLE_NAME           | VARIABLE_VALUE    |
+-------------------------+-------------------+
| innodb_buffer_pool_size | 12884901888       |
| innodb_flush_method     | O_DIRECT_NO_FSYNC |
| innodb_log_file_size    | 1073741824        |
+-------------------------+-------------------+
3 rows in set (0.01 sec)
```

以上です。

次回（MySQL Advent Calendar 2020 21 日目）はこの環境を r5.large インスタンスと比較してみます。

 - **[MySQL を使って EC2 r6g.large vs r5.large（mysqlslap 対決）をやってみた](https://qiita.com/hmatsu47/items/e20c4d69b0af465b0b12)**

---

 - **[Qiitaに投稿したMySQL 8.0関連記事](https://hmatsu47.hatenablog.com/qiita_mysql80)**
 - **[MySQL 8.0 の薄い本](https://github.com/hmatsu47/mysql80_no_usui_hon)（無料で配布中！）**