mysqlのリポジトリ
リポジトリの追加説明についてはこちらに記載がありますので、それを参考に実施します。
https://dev.mysql.com/downloads/repo/yum/
# curl https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm -o /usr/local/src/mysql57-community-release-el7-11.noarch.rpm
# rpm -ivh /usr/local/src/mysql57-community-release-el7-11.noarch.rpm
mysqlインストール
mysqlをインストールします。mariadb-libsがインストールされていますが、自動で置き換えられます。
# yum --enablerepo=mysql57-community install mysql-community-server mysql-community-devel 読み込んだプラグイン:fastestmirror Loading mirror speeds from cached hostfile * base: ftp.riken.jp * extras: ftp.riken.jp * remi-safe: mirrors.mediatemple.net * updates: ftp.tsukuba.wide.ad.jp 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ mysql-community-devel.x86_64 0:5.7.20-1.el7 を インストール --> 依存性の処理をしています: mysql-community-libs(x86-64) >= 5.7.9 のパッケージ: mysql-community-devel-5.7.20-1.el7.x86_64 --> 依存性の処理をしています: libmysqlclient.so.20()(64bit) のパッケージ: mysql-community-devel-5.7.20-1.el7.x86_64 ---> パッケージ mysql-community-server.x86_64 0:5.7.20-1.el7 を インストール --> 依存性の処理をしています: mysql-community-common(x86-64) = 5.7.20-1.el7 のパッケージ: mysql-community-server-5.7.20-1.el7.x86_64 --> 依存性の処理をしています: mysql-community-client(x86-64) >= 5.7.9 のパッケージ: mysql-community-server-5.7.20-1.el7.x86_64 --> 依存性の処理をしています: perl(strict) のパッケージ: mysql-community-server-5.7.20-1.el7.x86_64 --> 依存性の処理をしています: perl(Getopt::Long) のパッケージ: mysql-community-server-5.7.20-1.el7.x86_64 --> 依存性の処理をしています: net-tools のパッケージ: mysql-community-server-5.7.20-1.el7.x86_64 --> 依存性の処理をしています: /usr/bin/perl のパッケージ: mysql-community-server-5.7.20-1.el7.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ mariadb-libs.x86_64 1:5.5.56-2.el7 を 不要 --> 依存性の処理をしています: libmysqlclient.so.18()(64bit) のパッケージ: 2:postfix-2.10.1-6.el7.x86_64 --> 依存性の処理をしています: libmysqlclient.so.18(libmysqlclient_18)(64bit) のパッケージ: 2:postfix-2.10.1-6.el7.x86_64 ---> パッケージ mysql-community-client.x86_64 0:5.7.20-1.el7 を インストール ---> パッケージ mysql-community-common.x86_64 0:5.7.20-1.el7 を インストール ---> パッケージ mysql-community-libs.x86_64 0:5.7.20-1.el7 を 非推奨 ---> パッケージ net-tools.x86_64 0:2.0-0.22.20131004git.el7 を インストール ---> パッケージ perl.x86_64 4:5.16.3-292.el7 を インストール --> 依存性の処理をしています: perl-libs = 4:5.16.3-292.el7 のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Socket) >= 1.3 のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Scalar::Util) >= 1.10 のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl-macros のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl-libs のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(threads::shared) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(threads) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(constant) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Time::Local) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Time::HiRes) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Storable) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Socket) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Scalar::Util) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Pod::Simple::XHTML) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Pod::Simple::Search) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Filter::Util::Call) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(File::Temp) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(File::Spec::Unix) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(File::Spec::Functions) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(File::Spec) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(File::Path) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Exporter) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Cwd) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: perl(Carp) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 --> 依存性の処理をしています: libperl.so()(64bit) のパッケージ: 4:perl-5.16.3-292.el7.x86_64 ---> パッケージ perl-Getopt-Long.noarch 0:2.40-2.el7 を インストール --> 依存性の処理をしています: perl(Pod::Usage) >= 1.14 のパッケージ: perl-Getopt-Long-2.40-2.el7.noarch --> 依存性の処理をしています: perl(Text::ParseWords) のパッケージ: perl-Getopt-Long-2.40-2.el7.noarch --> トランザクションの確認を実行しています。 ---> パッケージ mysql-community-libs-compat.x86_64 0:5.7.20-1.el7 を 非推奨 ---> パッケージ perl-Carp.noarch 0:1.26-244.el7 を インストール ---> パッケージ perl-Exporter.noarch 0:5.68-3.el7 を インストール ---> パッケージ perl-File-Path.noarch 0:2.09-2.el7 を インストール ---> パッケージ perl-File-Temp.noarch 0:0.23.01-3.el7 を インストール ---> パッケージ perl-Filter.x86_64 0:1.49-3.el7 を インストール ---> パッケージ perl-PathTools.x86_64 0:3.40-5.el7 を インストール ---> パッケージ perl-Pod-Simple.noarch 1:3.28-4.el7 を インストール --> 依存性の処理をしています: perl(Pod::Escapes) >= 1.04 のパッケージ: 1:perl-Pod-Simple-3.28-4.el7.noarch --> 依存性の処理をしています: perl(Encode) のパッケージ: 1:perl-Pod-Simple-3.28-4.el7.noarch ---> パッケージ perl-Pod-Usage.noarch 0:1.63-3.el7 を インストール --> 依存性の処理をしています: perl(Pod::Text) >= 3.15 のパッケージ: perl-Pod-Usage-1.63-3.el7.noarch --> 依存性の処理をしています: perl-Pod-Perldoc のパッケージ: perl-Pod-Usage-1.63-3.el7.noarch ---> パッケージ perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 を インストール ---> パッケージ perl-Socket.x86_64 0:2.010-4.el7 を インストール ---> パッケージ perl-Storable.x86_64 0:2.45-3.el7 を インストール ---> パッケージ perl-Text-ParseWords.noarch 0:3.29-4.el7 を インストール ---> パッケージ perl-Time-HiRes.x86_64 4:1.9725-3.el7 を インストール ---> パッケージ perl-Time-Local.noarch 0:1.2300-2.el7 を インストール ---> パッケージ perl-constant.noarch 0:1.27-2.el7 を インストール ---> パッケージ perl-libs.x86_64 4:5.16.3-292.el7 を インストール ---> パッケージ perl-macros.x86_64 4:5.16.3-292.el7 を インストール ---> パッケージ perl-threads.x86_64 0:1.87-4.el7 を インストール ---> パッケージ perl-threads-shared.x86_64 0:1.43-6.el7 を インストール --> トランザクションの確認を実行しています。 ---> パッケージ perl-Encode.x86_64 0:2.51-7.el7 を インストール ---> パッケージ perl-Pod-Escapes.noarch 1:1.04-292.el7 を インストール ---> パッケージ perl-Pod-Perldoc.noarch 0:3.20-4.el7 を インストール --> 依存性の処理をしています: perl(parent) のパッケージ: perl-Pod-Perldoc-3.20-4.el7.noarch --> 依存性の処理をしています: perl(HTTP::Tiny) のパッケージ: perl-Pod-Perldoc-3.20-4.el7.noarch ---> パッケージ perl-podlators.noarch 0:2.5.1-3.el7 を インストール --> トランザクションの確認を実行しています。 ---> パッケージ perl-HTTP-Tiny.noarch 0:0.033-3.el7 を インストール ---> パッケージ perl-parent.noarch 1:0.225-244.el7 を インストール --> 依存性解決を終了しました。 依存性を解決しました ========================================================================================================= Package アーキテクチャー バージョン リポジトリー 容量 ========================================================================================================= インストール中: mysql-community-devel x86_64 5.7.20-1.el7 mysql57-community 3.6 M mysql-community-libs x86_64 5.7.20-1.el7 mysql57-community 2.1 M mariadb-libs.x86_64 1:5.5.56-2.el7 を入れ替えます mysql-community-libs-compat x86_64 5.7.20-1.el7 mysql57-community 2.0 M mariadb-libs.x86_64 1:5.5.56-2.el7 を入れ替えます mysql-community-server x86_64 5.7.20-1.el7 mysql57-community 164 M 依存性関連でのインストールをします: mysql-community-client x86_64 5.7.20-1.el7 mysql57-community 24 M mysql-community-common x86_64 5.7.20-1.el7 mysql57-community 272 k net-tools x86_64 2.0-0.22.20131004git.el7 base 305 k perl x86_64 4:5.16.3-292.el7 base 8.0 M perl-Carp noarch 1.26-244.el7 base 19 k perl-Encode x86_64 2.51-7.el7 base 1.5 M perl-Exporter noarch 5.68-3.el7 base 28 k perl-File-Path noarch 2.09-2.el7 base 26 k perl-File-Temp noarch 0.23.01-3.el7 base 56 k perl-Filter x86_64 1.49-3.el7 base 76 k perl-Getopt-Long noarch 2.40-2.el7 base 56 k perl-HTTP-Tiny noarch 0.033-3.el7 base 38 k perl-PathTools x86_64 3.40-5.el7 base 82 k perl-Pod-Escapes noarch 1:1.04-292.el7 base 51 k perl-Pod-Perldoc noarch 3.20-4.el7 base 87 k perl-Pod-Simple noarch 1:3.28-4.el7 base 216 k perl-Pod-Usage noarch 1.63-3.el7 base 27 k perl-Scalar-List-Utils x86_64 1.27-248.el7 base 36 k perl-Socket x86_64 2.010-4.el7 base 49 k perl-Storable x86_64 2.45-3.el7 base 77 k perl-Text-ParseWords noarch 3.29-4.el7 base 14 k perl-Time-HiRes x86_64 4:1.9725-3.el7 base 45 k perl-Time-Local noarch 1.2300-2.el7 base 24 k perl-constant noarch 1.27-2.el7 base 19 k perl-libs x86_64 4:5.16.3-292.el7 base 688 k perl-macros x86_64 4:5.16.3-292.el7 base 43 k perl-parent noarch 1:0.225-244.el7 base 12 k perl-podlators noarch 2.5.1-3.el7 base 112 k perl-threads x86_64 1.87-4.el7 base 49 k perl-threads-shared x86_64 1.43-6.el7 base 39 k トランザクションの要約 ========================================================================================================= インストール 4 パッケージ (+30 個の依存関係のパッケージ) 総ダウンロード容量: 207 M Is this ok [y/d/N]: y Downloading packages: 警告: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.20-1.el7.x86_64.rpm: ヘッダー V3 DSA/SHA1 Signature、鍵 ID 5072e1f5: NOKEY mysql-community-common-5.7.20-1.el7.x86_64.rpm の公開鍵がインストールされていません (1/34): mysql-community-common-5.7.20-1.el7.x86_64.rpm | 272 kB 00:00:00 (2/34): mysql-community-devel-5.7.20-1.el7.x86_64.rpm | 3.6 MB 00:00:00 (3/34): mysql-community-libs-5.7.20-1.el7.x86_64.rpm | 2.1 MB 00:00:00 (4/34): mysql-community-libs-compat-5.7.20-1.el7.x86_64.rpm | 2.0 MB 00:00:00 (5/34): perl-Carp-1.26-244.el7.noarch.rpm | 19 kB 00:00:00 (6/34): net-tools-2.0-0.22.20131004git.el7.x86_64.rpm | 305 kB 00:00:00 (7/34): perl-Exporter-5.68-3.el7.noarch.rpm | 28 kB 00:00:00 (8/34): perl-File-Path-2.09-2.el7.noarch.rpm | 26 kB 00:00:00 (9/34): perl-File-Temp-0.23.01-3.el7.noarch.rpm | 56 kB 00:00:00 (10/34): perl-Filter-1.49-3.el7.x86_64.rpm | 76 kB 00:00:00 (11/34): perl-Getopt-Long-2.40-2.el7.noarch.rpm | 56 kB 00:00:00 (12/34): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm | 38 kB 00:00:00 (13/34): mysql-community-client-5.7.20-1.el7.x86_64.rpm | 24 MB 00:00:01 (14/34): perl-PathTools-3.40-5.el7.x86_64.rpm | 82 kB 00:00:00 (15/34): perl-Encode-2.51-7.el7.x86_64.rpm | 1.5 MB 00:00:00 (16/34): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm | 87 kB 00:00:00 (17/34): perl-Pod-Escapes-1.04-292.el7.noarch.rpm | 51 kB 00:00:00 (18/34): perl-Pod-Usage-1.63-3.el7.noarch.rpm | 27 kB 00:00:00 (19/34): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm | 36 kB 00:00:00 (20/34): perl-Storable-2.45-3.el7.x86_64.rpm | 77 kB 00:00:00 (21/34): perl-Text-ParseWords-3.29-4.el7.noarch.rpm | 14 kB 00:00:00 (22/34): perl-Socket-2.010-4.el7.x86_64.rpm | 49 kB 00:00:00 (23/34): perl-Pod-Simple-3.28-4.el7.noarch.rpm | 216 kB 00:00:00 (24/34): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm | 45 kB 00:00:00 (25/34): perl-Time-Local-1.2300-2.el7.noarch.rpm | 24 kB 00:00:00 (26/34): perl-constant-1.27-2.el7.noarch.rpm | 19 kB 00:00:00 (27/34): perl-parent-0.225-244.el7.noarch.rpm | 12 kB 00:00:00 (28/34): perl-macros-5.16.3-292.el7.x86_64.rpm | 43 kB 00:00:00 (29/34): perl-5.16.3-292.el7.x86_64.rpm | 8.0 MB 00:00:01 (30/34): perl-threads-1.87-4.el7.x86_64.rpm | 49 kB 00:00:00 (31/34): perl-podlators-2.5.1-3.el7.noarch.rpm | 112 kB 00:00:00 (32/34): perl-threads-shared-1.43-6.el7.x86_64.rpm | 39 kB 00:00:00 (33/34): perl-libs-5.16.3-292.el7.x86_64.rpm | 688 kB 00:00:00 (34/34): mysql-community-server-5.7.20-1.el7.x86_64.rpm | 164 MB 00:00:03 --------------------------------------------------------------------------------------------------------- 合計 47 MB/s | 207 MB 00:00:04 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql から鍵を取得中です。 Importing GPG key 0x5072E1F5: Userid : "MySQL Release Engineering <mysql-build\@oss.oracle.com>;" Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5 Package : mysql57-community-release-el7-11.noarch (installed) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 上記の処理を行います。よろしいでしょうか? [y/N]y Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : mysql-community-common-5.7.20-1.el7.x86_64 1/35 インストール中 : mysql-community-libs-5.7.20-1.el7.x86_64 2/35 インストール中 : mysql-community-client-5.7.20-1.el7.x86_64 3/35 インストール中 : 1:perl-parent-0.225-244.el7.noarch 4/35 インストール中 : perl-HTTP-Tiny-0.033-3.el7.noarch 5/35 インストール中 : perl-podlators-2.5.1-3.el7.noarch 6/35 インストール中 : perl-Pod-Perldoc-3.20-4.el7.noarch 7/35 インストール中 : 1:perl-Pod-Escapes-1.04-292.el7.noarch 8/35 インストール中 : perl-Text-ParseWords-3.29-4.el7.noarch 9/35 インストール中 : perl-Encode-2.51-7.el7.x86_64 10/35 インストール中 : perl-Pod-Usage-1.63-3.el7.noarch 11/35 インストール中 : 4:perl-macros-5.16.3-292.el7.x86_64 12/35 インストール中 : 4:perl-libs-5.16.3-292.el7.x86_64 13/35 インストール中 : perl-Storable-2.45-3.el7.x86_64 14/35 インストール中 : perl-Exporter-5.68-3.el7.noarch 15/35 インストール中 : perl-constant-1.27-2.el7.noarch 16/35 インストール中 : perl-Time-Local-1.2300-2.el7.noarch 17/35 インストール中 : perl-Socket-2.010-4.el7.x86_64 18/35 インストール中 : perl-Carp-1.26-244.el7.noarch 19/35 インストール中 : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 20/35 インストール中 : perl-PathTools-3.40-5.el7.x86_64 21/35 インストール中 : perl-Scalar-List-Utils-1.27-248.el7.x86_64 22/35 インストール中 : perl-File-Temp-0.23.01-3.el7.noarch 23/35 インストール中 : perl-File-Path-2.09-2.el7.noarch 24/35 インストール中 : perl-threads-shared-1.43-6.el7.x86_64 25/35 インストール中 : perl-threads-1.87-4.el7.x86_64 26/35 インストール中 : perl-Filter-1.49-3.el7.x86_64 27/35 インストール中 : 1:perl-Pod-Simple-3.28-4.el7.noarch 28/35 インストール中 : perl-Getopt-Long-2.40-2.el7.noarch 29/35 インストール中 : 4:perl-5.16.3-292.el7.x86_64 30/35 インストール中 : net-tools-2.0-0.22.20131004git.el7.x86_64 31/35 インストール中 : mysql-community-server-5.7.20-1.el7.x86_64 32/35 インストール中 : mysql-community-libs-compat-5.7.20-1.el7.x86_64 33/35 インストール中 : mysql-community-devel-5.7.20-1.el7.x86_64 34/35 削除中 : 1:mariadb-libs-5.5.56-2.el7.x86_64 35/35 検証中 : perl-HTTP-Tiny-0.033-3.el7.noarch 1/35 検証中 : net-tools-2.0-0.22.20131004git.el7.x86_64 2/35 検証中 : perl-threads-shared-1.43-6.el7.x86_64 3/35 検証中 : perl-Storable-2.45-3.el7.x86_64 4/35 検証中 : perl-Exporter-5.68-3.el7.noarch 5/35 検証中 : perl-constant-1.27-2.el7.noarch 6/35 検証中 : perl-PathTools-3.40-5.el7.x86_64 7/35 検証中 : mysql-community-client-5.7.20-1.el7.x86_64 8/35 検証中 : 4:perl-macros-5.16.3-292.el7.x86_64 9/35 検証中 : mysql-community-libs-compat-5.7.20-1.el7.x86_64 10/35 検証中 : 1:perl-parent-0.225-244.el7.noarch 11/35 検証中 : 4:perl-5.16.3-292.el7.x86_64 12/35 検証中 : 1:perl-Pod-Simple-3.28-4.el7.noarch 13/35 検証中 : mysql-community-common-5.7.20-1.el7.x86_64 14/35 検証中 : perl-File-Temp-0.23.01-3.el7.noarch 15/35 検証中 : mysql-community-devel-5.7.20-1.el7.x86_64 16/35 検証中 : perl-Time-Local-1.2300-2.el7.noarch 17/35 検証中 : 4:perl-libs-5.16.3-292.el7.x86_64 18/35 検証中 : perl-Pod-Perldoc-3.20-4.el7.noarch 19/35 検証中 : perl-Socket-2.010-4.el7.x86_64 20/35 検証中 : mysql-community-libs-5.7.20-1.el7.x86_64 21/35 検証中 : perl-Carp-1.26-244.el7.noarch 22/35 検証中 : mysql-community-server-5.7.20-1.el7.x86_64 23/35 検証中 : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 24/35 検証中 : perl-Scalar-List-Utils-1.27-248.el7.x86_64 25/35 検証中 : 1:perl-Pod-Escapes-1.04-292.el7.noarch 26/35 検証中 : perl-Pod-Usage-1.63-3.el7.noarch 27/35 検証中 : perl-Encode-2.51-7.el7.x86_64 28/35 検証中 : perl-podlators-2.5.1-3.el7.noarch 29/35 検証中 : perl-Getopt-Long-2.40-2.el7.noarch 30/35 検証中 : perl-File-Path-2.09-2.el7.noarch 31/35 検証中 : perl-threads-1.87-4.el7.x86_64 32/35 検証中 : perl-Filter-1.49-3.el7.x86_64 33/35 検証中 : perl-Text-ParseWords-3.29-4.el7.noarch 34/35 検証中 : 1:mariadb-libs-5.5.56-2.el7.x86_64 35/35 インストール: mysql-community-devel.x86_64 0:5.7.20-1.el7 mysql-community-libs.x86_64 0:5.7.20-1.el7 mysql-community-libs-compat.x86_64 0:5.7.20-1.el7 mysql-community-server.x86_64 0:5.7.20-1.el7 依存性関連をインストールしました: mysql-community-client.x86_64 0:5.7.20-1.el7 mysql-community-common.x86_64 0:5.7.20-1.el7 net-tools.x86_64 0:2.0-0.22.20131004git.el7 perl.x86_64 4:5.16.3-292.el7 perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 perl-Exporter.noarch 0:5.68-3.el7 perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-2.el7 perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-292.el7 perl-Pod-Perldoc.noarch 0:3.20-4.el7 perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-4.el7 perl-Storable.x86_64 0:2.45-3.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7 perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-292.el7 perl-macros.x86_64 4:5.16.3-292.el7 perl-parent.noarch 1:0.225-244.el7 perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7 置換: mariadb-libs.x86_64 1:5.5.56-2.el7 完了しました! # # #
インストール後のVer確認
# mysqld --version mysqld Ver 5.7.20 for Linux on x86_64 (MySQL Community Server (GPL)) #
mysqlサーバの起動
# systemctl start mysqld.service # systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since 木 2017-10-26 16:41:05 JST; 11s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 17530 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 17456 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 17532 (mysqld) CGroup: /system.slice/mysqld.service mq17532 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid 10月 26 16:41:00 hoge.hoge systemd[1]: Starting MySQL Server... 10月 26 16:41:05 hoge.hoge systemd[1]: Started MySQL Server. #
初期のrootパスワードはmysqld.logに出力されます
# grep password /var/log/mysqld.log
2017-10-26T07:41:01.042114Z 1 [Note] A temporary password is generated for root@localhost: Cxc)JcUke8%d
#
mysql_secure_installation コマンドを実行して、MySQL のセキュリティ設定を行います。
# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: ←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' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. 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) : y New password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y 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 6 Server version: 5.7.20 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> mysql> \q Bye #
パスワードの有効期限がデフォルトで360日とります。360日を経過するとパスワードの変更を促されて MySQL にログインできなくなります。なので、有効期限を無に変更します。
# vi /etc/my.cnf
[mysqld] . . . character-set-server = utf8 default_password_lifetime = 0