LoginSignup
3
3

More than 5 years have passed since last update.

CentOS6.5にMySQL5.7をインストールする

Posted at

リポジトリを追加

リポジトリはmysqlの公式のyumリポジトリで確認してください。
(※ 今回のはcentos6用なので、centos7の場合は別です)

# yum localinstall http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm
Loaded plugins: fastestmirror, security
Setting up Local Package Process
mysql57-community-release-el6-8.noarch.rpm                                                                                                                                | 8.9 kB     00:00
Examining /var/tmp/yum-root-sWSouw/mysql57-community-release-el6-8.noarch.rpm: mysql57-community-release-el6-8.noarch
Marking /var/tmp/yum-root-sWSouw/mysql57-community-release-el6-8.noarch.rpm to be installed
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el6-8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================
 Package                                             Arch                             Version                            Repository                                                         Size
=================================================================================================================================================================================================
Installing:
 mysql57-community-release                           noarch                           el6-8                              /mysql57-community-release-el6-8.noarch                           8.2 k

Transaction Summary
=================================================================================================================================================================================================
Install       1 Package(s)

Total size: 8.2 k
Installed size: 8.2 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mysql57-community-release-el6-8.noarch                                                                                                                                        1/1
  Verifying  : mysql57-community-release-el6-8.noarch                                                                                                                                        1/1

Installed:
  mysql57-community-release.noarch 0:el6-8

Complete!

ちゃんとリポジトリが追加されてるか

# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
repo id                                                                                      repo name                                                                                     status
base                                                                                         CentOS-6 - Base                                                                               6,696
extras                                                                                       CentOS-6 - Extras                                                                                62
jenkins                                                                                      Jenkins                                                                                         352
mysql-connectors-community                                                                   MySQL Connectors Community                                                                       21
mysql-tools-community                                                                        MySQL Tools Community                                                                            38
mysql57-community                                                                            MySQL 5.7 Community Server                                                                      130
updates                                                                                      CentOS-6 - Updates                                                                              478
repolist: 7,777

mysql57-communityが追加されてます。

インストールしてみる

# yum install --enablerepo=mysql57-community mysql-community-server

途中でこれでOKか聞かれるが、`y`で。

Installed:
  mysql-community-server.x86_64 0:5.7.15-1.el6

Dependency Installed:
  mysql-community-client.x86_64 0:5.7.15-1.el6                    mysql-community-common.x86_64 0:5.7.15-1.el6                    mysql-community-libs.x86_64 0:5.7.15-1.el6

Complete!

起動

# service mysqld start
MySQL データベースを初期化中:                              [  OK  ]
Installing validate password plugin:                       [  OK  ]
mysqld を起動中:                                           [  OK  ]

初期設定

mysql5.7ではセキュリティが強化され、初期設定で良しなにやってくれるようになりました。
その辺は私の以前の記事(MySQL5.7の初期設定まとめ
)を参考にしてください。

3
3
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
3
3