Translated message

A translation of this page exists in English.

Red Hat Enterprise Linux 7 で MariaDB をアンインストールし、MySQL をインストールする

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7
  • mariadb-5.5.37-1
  • mysql55-1.1-23

Issue

  • Red Hat Enterprise Linux 7 で MariaDB をアンインストールし、MySQL をインストールするには
  • Red Hat Enterprise Linux 7 に MySQL をインストールして設定するには
  • Red Hat Enterprise Linux 7 に MySQL5.5 をインストールするには

Resolution

MariaDB をアンインストールするには、以下のコマンドを実行します。

# yum remove mariadb

RHEL7 では、MySQL パッケージは Red Hat Software Collection (RHSCL) チャンネルにのみ同梱されます。

RHSCL チャンネルへのアクセスを取得するには、こちらのナレッジを参照してください。

RHSCL チャンネルへのアクセスを取得したら、以下の手順に従ってください。

  1. システムに利用できるすべてのサブスクリプションを一覧表示し、Red Hat Software Collections を提供するサブスクリプションのプール ID を特定します。

    # subscription-manager list --available
    

    以下のいずれかのチャンネルを持つサブスクリプションが特定できます。

    Red Hat Software Collections (for RHEL Workstation)
    Red Hat Software Collections (for RHEL Server)
    

    サブスクリプションが特定できたら、その "POOL ID" を書き留めます。

  2. "pool id" を使用して必要なサブスクリプションを追加します。

    # subscription-manager attach --pool=pool_id
    
  3. yum のキャッシュを削除して、利用可能なすべてのリポジトリーを一覧表示します。

    # yum clean all
    # yum repolist all
    
  4. リポジトリー一覧から RHSCL リポジトリーを特定します。

    rhel-variant-rhscl-7-rpms                     ==
    rhel-variant-rhscl-7-debug-rpms                 |=== Repository ID of RHCSCL repository 
    rhel-variant-rhscl-7-source-rpms              ==
    

    "variant" の代わりに "Server" か "Workstation" を確認できます。

  5. RHSCL リポジトリーを有効にします。

    # subscription-manager repos --enable <Repo-Id>
    例:  
    # subscription-manager repos --enable=rhel-server-rhscl-7-rpms
    
  6. ここで、MySQL をインストールします。

    # yum install mysql55*
    
  7. PATH 変数を設定します。

    export PATH=$PATH:/opt/rh/mysql55/root/usr/bin/
    
  8. MySQL サービスを開始します。

    # systemctl start mysql55-mysqld.service
    
  9. 再起動時に MySQL を有効にします。

    # systemctl enable mysql55-mysqld.service
    
  10. MySQL サービスの状態を確認します。

    # systemctl status mysql55-mysqld.service
    

    RHSCL を取得する方法については、こちらを参照してください。

参照:

  1. How to access and download Red Hat Software Collections (RHSCL) and/or Red Hat Developer Toolset (DTS)?

  2. Migrating from MySQL 5.1 (RHEL-6) to MariaDB 5.5 (RHEL-7)

  3. How are included databases such as PostgreSQL, MySQL, MariaDB, and MongoDB supported by Red Hat?

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments