LoginSignup
5
2

More than 5 years have passed since last update.

2018年11月15日頃にRed Hat Enterprise Linuxの最新版8.0のベータ版がリリースされました。
Fedora28がベースとなっていてカーネルも従来RHEL7の3系から4.18となっている一方、
デフォルトで入っているミドルウェアもMySQL8、MariaDB10.3、PostgreSQL10など比較的新しくなっていることが少し話題となりました。

今回はRHEL6以来再びバンドルされるようになったMySQLをRHEL8でインストールして触ってみます。

事前準備

Red Hatユーザーアカウントを持っていない場合はまず新規登録を行い、isoファイルをダウンロードしてきます。
アカウントを新規作成した場合は一度ポータルサイトにログインし、利用条件にチェックを入れて承諾しておく必要があります。

RHEL8 betaをVirtualBox上にインストール

以下のマニュアルに沿ってVirtualBox上にRHEL8 betaインスタンスを作ります。
https://developers.redhat.com/rhel8/install-rhel8-vbox/

yumの実行にRed Hat Subscription Managementへの登録が必要なので、subscription-managerコマンドを実行して先程使用したRed Hatユーザーアカウントのユーザー名とパスワードを入力します。

subscription-manager register --auto-attach

上記が完了したらyumでMySQLをインストールします。

# yum install mysql

Dependencies resolved.
=======================================================================================
 Package Arch   Version                    Repository                             Size
=======================================================================================
Installing:
 mysql   x86_64 8.0.12-6.el8+1923+5642a751 rhel-8-for-x86_64-appstream-beta-rpms 9.0 M
Installing dependencies:
 mysql-common
         x86_64 8.0.12-6.el8+1923+5642a751 rhel-8-for-x86_64-appstream-beta-rpms 137 k
 mariadb-connector-c-config
         noarch 3.0.6-2.el8                rhel-8-for-x86_64-appstream-beta-rpms  13 k
Enabling module streams:
 mysql          8.0                                                                   

Transaction Summary
=======================================================================================
Install  3 Packages

Total download size: 9.2 M
Installed size: 58 M
Is this ok [y/N]:

バージョンは8.0.12ですね。(今の最新版は8.0.13)
インストールが終わると関連コンポーネントが追加されるので、続いてMySQLサーバ本体をインストールします。

# yum install mysql-server

Dependencies resolved.
=======================================================================================
 Package
        Arch   Version                     Repository                             Size
=======================================================================================
Installing:
 mysql-server
        x86_64 8.0.12-6.el8+1923+5642a751  rhel-8-for-x86_64-appstream-beta-rpms  25 M
Installing dependencies:
 mecab  x86_64 0.996-1.el8+1521+e4919bed.9 rhel-8-for-x86_64-appstream-beta-rpms 396 k
 protobuf-lite
        x86_64 3.5.0-7.el8                 rhel-8-for-x86_64-appstream-beta-rpms 149 k
 mysql-errmsg
        x86_64 8.0.12-6.el8+1923+5642a751  rhel-8-for-x86_64-appstream-beta-rpms 512 k

Transaction Summary
=======================================================================================
Install  4 Packages

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

以上インストールが終わったらMySQLを起動します。

# systemctl start mysqld

標準パッケージと異なりデフォルトパスワードは生成されないようです。(内部的に --initialize-insecureオプションが効いている模様)

# vi /var/log/mysql/mysqld.log
...
[Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

なのでこのままmysql_secure_installationを実行します。

# mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No:

...

All done!

これでログイン可能となります。

# mysql -uroot -p

その他

default_authentication_pluginのデフォルト値は8.0以降のオフィシャル標準であるcaching_sha2_passwordではなくmysql_native_passwordに変えられているようです。アプリの対応状況などを鑑みてのことでしょうか?

mysql> show variables like '%auth%';
+-------------------------------+-----------------------+
| Variable_name                 | Value                 |
+-------------------------------+-----------------------+
| default_authentication_plugin | mysql_native_password |
+-------------------------------+-----------------------+
1 row in set (0.00 sec)

またMySQL ShellやMySQL Routerは入っていないなのでこれらを使う場合はOracle標準のパッケージが必要です。

5
2
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
5
2