LoginSignup
2
1

More than 5 years have passed since last update.

yum で mysql5.6をインストールする

Posted at

mysql8 が出ています。おめでとうございます。

開発サーバと言う名の、(僕が)壊しては直すツギハギの検証みたいなマシンがありまして、そいつが CentOS 6.9、標準リポジトリの MySQL 5.1 を使っています。開発の都合上、そろそろ mysql5.6 を使いたいので、5.6をインストールしたいのですがコンパイルしてインストールするのも面倒なので yum を使いたいという感じです。

あらかじめ

  1. 前のデータが dump.sql で存在するので、それのインポートもします。
  2. 既存のmysqlは 全て アンインストールしておきます。
  3. 作業とかいちいち sudo を付けるのが面倒なので、 sudo -i で root 権限を持った状態で作業。

リポジトリをインストール

> rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm

rpm のURLは mysql をリリースする度に変わるので公式で確認をするように。

使うリポジトリを変更

書きたいのはここ。初期状態では mysql80-community を使うようになっているので、mysql56-community を使うようにする。

> yum-config-manager --disable mysql80-community
> yum-config-manager --enable mysql56-community

確認は必要。なんかいろいろ入っているけど、面倒なのでほったらしている。

> yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * epel: ftp.riken.jp
 * ius: mirrors.tongji.edu.cn
 * rpmforge: ftp.riken.jp
repo id                    repo name                status
base                       CentOS-6 - Base           6706
epel                       Extra Packages for Enter 12501
extras                     CentOS-6 - Extras           53
ius                        IUS Community Packages f   389
mackerel                   mackerel-agent               4
mysql-connectors-community MySQL Connectors Communi    49
mysql-tools-community      MySQL Tools Community       61
mysql56-community          MySQL 5.6 Community Serv   434
newrelic                   New Relic packages for E   171
rpmforge                   RHEL 6 - RPMforge.net -   4718
updates                    CentOS-6 - Updates        1185

mysql をインストール

> yum install -y mysql-community-client mysql-community-common mysql-community-devel mysql-community-embedded mysql-community-embedded-devel mysql-community-libs mysql-community-libs-compat mysql-community-server

...

> mysql --version
mysql  Ver 14.14 Distrib 5.6.40, for Linux (x86_64) using  EditLine wrapper
2
1
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
2
1