CentOS7のMariaDBを10.1にアップデートする方法

CentOS7ではデフォルトでMariaDB5.5が入ってます。今回はこれを10.1にアップデートします

バージョン確認

まずはバージョン確認します

1[root@localhost ~]# mysql --version
2mysql  Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1

5.5ですね。というわけでアップデートします

アップデート

公式リポジトリの追加

公式リポジトリを追加します

1[root@localhost ~]# vi /etc/yum.repos.d/MariaDB.repo
2# MariaDB 10.1 CentOS repository list
3# http://mariadb.org/mariadb/repositories/
4[mariadb]
5name = MariaDB
6baseurl = http://yum.mariadb.org/10.1/centos7-amd64
7gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
8gpgcheck=1

終わったら今度はDBを停止します

MariaDBを停止

1[root@localhost ~]# systemctl stop mariadb

停止をしたら今度はアップデートします

MariaDBアップデート

01[root@localhost ~]# yum update mariadb-server
02読み込んだプラグイン:fastestmirror
03Loading mirror speeds from cached hostfile
04 * remi-safe: mirrors.tuna.tsinghua.edu.cn
05依存性の解決をしています
06--> トランザクションの確認を実行しています。
07---> パッケージ MariaDB-server.x86_64 0:10.1.32-1.el7.centos を 非推奨
08--> 依存性の処理をしています: galera のパッケージ: MariaDB-server-10.1.32-1.el7.centos.x86_64
09--> 依存性の処理をしています: MariaDB-common のパッケージ: MariaDB-server-10.1.32-1.el7.centos.x86_64
10--> 依存性の処理をしています: MariaDB-client のパッケージ: MariaDB-server-10.1.32-1.el7.centos.x86_64
11---> パッケージ mariadb-server.x86_64 1:5.5.56-2.el7 を 不要
12--> トランザクションの確認を実行しています。
13---> パッケージ MariaDB-client.x86_64 0:10.1.32-1.el7.centos を 非推奨
14---> パッケージ MariaDB-common.x86_64 0:10.1.32-1.el7.centos を インストール
15---> パッケージ galera.x86_64 0:25.3.23-1.rhel7.el7.centos を インストール
16---> パッケージ mariadb.x86_64 1:5.5.56-2.el7 を 不要
17--> 衝突を処理しています: MariaDB-common-10.1.32-1.el7.centos.x86_64 は mariadb-libs < 1:10.1.32-1.el7.centos と衝突しています --> 新しい変更と依存性の解決を再開しています。
18--> トランザクションの確認を実行しています。
19---> パッケージ MariaDB-shared.x86_64 0:10.1.32-1.el7.centos を 非推奨
20---> パッケージ mariadb-libs.x86_64 1:5.5.56-2.el7 を 不要
21--> 依存性の処理をしています: mariadb-libs(x86-64) = 1:5.5.56-2.el7 のパッケージ: 1:mariadb-devel-5.5.56-2.el7.x86_64
22--> トランザクションの確認を実行しています。
23---> パッケージ MariaDB-devel.x86_64 0:10.1.32-1.el7.centos を 非推奨
24---> パッケージ mariadb-devel.x86_64 1:5.5.56-2.el7 を 不要
25--> 依存性解決を終了しました。
26 
27依存性を解決しました
28 
29=============================================================================================================================================================================================================================================================================================================================
30 Package                                                                       アーキテクチャー                                                      バージョン                                                                                 リポジトリー                                                            容量
31=============================================================================================================================================================================================================================================================================================================================
32インストール中:
33 MariaDB-client                                                                x86_64                                                                10.1.32-1.el7.centos                                                                       mariadb                                                                 39 M
34     mariadb.x86_64 1:5.5.56-2.el7 を入れ替えます
35 MariaDB-devel                                                                 x86_64                                                                10.1.32-1.el7.centos                                                                       mariadb                                                                6.6 M
36     mariadb-devel.x86_64 1:5.5.56-2.el7 を入れ替えます
37 MariaDB-server                                                                x86_64                                                                10.1.32-1.el7.centos                                                                       mariadb                                                                104 M
38     mariadb-server.x86_64 1:5.5.56-2.el7 を入れ替えます
39 MariaDB-shared                                                                x86_64                                                                10.1.32-1.el7.centos                                                                       mariadb                                                                1.3 M
40     mariadb-libs.x86_64 1:5.5.56-2.el7 を入れ替えます
41依存性関連でのインストールをします:
42 MariaDB-common                                                                x86_64                                                                10.1.32-1.el7.centos                                                                       mariadb                                                                123 k
43 galera                                                                        x86_64                                                                25.3.23-1.rhel7.el7.centos                                                                 mariadb                                                                8.0 M
44 
45トランザクションの要約
46=============================================================================================================================================================================================================================================================================================================================
47インストール  4 パッケージ (+2 個の依存関係のパッケージ)
48 
49 
50 
51総ダウンロード容量: 159 M

yを押して続けます

01Downloading packages:
02警告: /var/cache/yum/x86_64/7/mariadb/packages/MariaDB-10.1.32-centos73-x86_64-common.rpm: ヘッダー V4 DSA/SHA1 Signature、鍵 ID 1bb943db: NOKEY 0% [                                                                                                                                      ] 139 kB/s | 149 kB  00:19:32 ETA
03MariaDB-10.1.32-centos73-x86_64-common.rpm の公開鍵がインストールされていません
04(1/6): MariaDB-10.1.32-centos73-x86_64-common.rpm                                                                                                                                                                                                                                                     | 123 kB  00:00:01
05(2/6): MariaDB-10.1.32-centos73-x86_64-client.rpm                                                                                                                                                                                                                                                     |  39 MB  00:00:05
06(3/6): MariaDB-10.1.32-centos73-x86_64-devel.rpm                                                                                                                                                                                                                                                      | 6.6 MB  00:00:08
07(4/6): MariaDB-10.1.32-centos73-x86_64-shared.rpm                                                                                                                                                                                                                                                     | 1.3 MB  00:00:00
08(5/6): galera-25.3.23-1.rhel7.el7.centos.x86_64.rpm                                                                                                                                                                                                                                                   | 8.0 MB  00:00:03
09(6/6): MariaDB-10.1.32-centos73-x86_64-server.rpm                                                                                                                                                                                                                                                     | 104 MB  00:00:09
10-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11合計                                                                                                                                                                                                                                                                                          11 MB/s | 159 MB  00:00:15
12https://yum.mariadb.org/RPM-GPG-KEY-MariaDB から鍵を取得中です。
13Importing GPG key 0x1BB943DB:
14 Userid     : "MariaDB Package Signing Key <package-signing-key@mariadb.org>"
15 Fingerprint: 1993 69e5 404b d5fc 7d2f e43b cbcb 082a 1bb9 43db
16 From       : https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
17上記の処理を行います。よろしいでしょうか? [y/N]y
18Running transaction check
19Running transaction test
20Transaction test succeeded
21Running transaction
22  インストール中          : MariaDB-common-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  1/10
23  インストール中          : MariaDB-client-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  2/10
24  インストール中          : galera-25.3.23-1.rhel7.el7.centos.x86_64                                                                                                                                                                                                                                                    3/10
25  インストール中          : MariaDB-server-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  4/10
26  インストール中          : MariaDB-devel-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                   5/10
27  インストール中          : MariaDB-shared-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  6/10
28  削除中                  : 1:mariadb-server-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                        7/10
29warning: /var/log/mariadb/mariadb.log saved as /var/log/mariadb/mariadb.log.rpmsave
30  削除中                  : 1:mariadb-devel-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                         8/10
31  削除中                  : 1:mariadb-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                               9/10
32  削除中                  : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                         10/10
33  検証中                  : MariaDB-server-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  1/10
34  検証中                  : MariaDB-common-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  2/10
35  検証中                  : MariaDB-devel-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                   3/10
36  検証中                  : galera-25.3.23-1.rhel7.el7.centos.x86_64                                                                                                                                                                                                                                                    4/10
37  検証中                  : MariaDB-client-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  5/10
38  検証中                  : MariaDB-shared-10.1.32-1.el7.centos.x86_64                                                                                                                                                                                                                                                  6/10
39  検証中                  : 1:mariadb-devel-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                         7/10
40  検証中                  : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                          8/10
41  検証中                  : 1:mariadb-server-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                        9/10
42  検証中                  : 1:mariadb-5.5.56-2.el7.x86_64                                                                                                                                                                                                                                                              10/10
43 
44インストール:
45  MariaDB-client.x86_64 0:10.1.32-1.el7.centos                                   MariaDB-devel.x86_64 0:10.1.32-1.el7.centos                                   MariaDB-server.x86_64 0:10.1.32-1.el7.centos                                   MariaDB-shared.x86_64 0:10.1.32-1.el7.centos
46 
47依存性関連をインストールしました:
48  MariaDB-common.x86_64 0:10.1.32-1.el7.centos                                                                                                                   galera.x86_64 0:25.3.23-1.rhel7.el7.centos
49 
50置換:
51  mariadb.x86_64 1:5.5.56-2.el7                                             mariadb-devel.x86_64 1:5.5.56-2.el7                                             mariadb-libs.x86_64 1:5.5.56-2.el7                                             mariadb-server.x86_64 1:5.5.56-2.el7
52 
53完了しました!

完了しました。念のため確認します

バージョン確認

1[root@localhost ~]# mysql --version
2mysql  Ver 15.1 Distrib 10.1.32-MariaDB, for Linux (x86_64) using readline 5.1

問題無いですね。というわけで起動します。

1[root@localhost ~]#systemctl start mariadb

個人支援・寄付について

サイトラボでは個人支援・寄付を受けております。ご協力いただける方はお願いいたします。当サイトではビットコインで受け付けております。

  • ビットコイン:3LHnADwZwUbic2L45EnVJEykiG6KfbqrwS