2014年12月30日火曜日

Fedora20にMySQLのインストール

Fedora20にMySQLをインストール


公式サイトからDownloadstタブからYum Repositoryをクリック。




すると下の方にRed Hat系のdownloadボタンがずらりと並んでいる。
今回はFedora20なのでFedora20のdownloadボタンをクリック。


するとSign Upを促されるが、下のリンク[No thanks, just start my download.]のリンクをコピーする。

そのリンクをrpmでインストール(mysqlがインストールされてないか確認後)

$ rpm -ihv http://dev.mysql.com/get/mysql-community-release-fc20-5.noarch.rpm

無事にインストールが済んだら、リポジトリの確認、mysqlリポジトリがあることを確認。

$ yum repolist
fedora/20/x86_64 Fedora 20 - x86_64 38,597
mysql-connectors-community/20/x86_64 MySQL Connectors Community 19
mysql-tools-community/20/x86_64 MySQL Tools Community 16
mysql56-community/20/x86_64 MySQL 5.6 Community Server 105 updates/20/x86_64 Fedora 20 - x86_64 - Updates 21,028
repolist: 59,810


続いて開発のためのmysql-server mysql-develをインストール

# yum install mysql-server mysql-devel

環境がすべて整ったかrpm -qaで確認

$ rpm -qa mysql*
mysql-community-release-fc20-5.noarch
mysql-community-common-5.6.22-1.fc20.x86_64
mysql-community-client-5.6.22-1.fc20.x86_64
[2439:2439:1230/013727:ERROR:texture_manager.cc(1546)] [.Compositor-0x7faa03908330]GL ERROR :GL_INVALID_VALUE : glTexImage2D: <- error from previous GL command
mysql-community-devel-5.6.22-1.fc20.x86_64
mysql-community-libs-5.6.22-1.fc20.x86_64
mysql-community-server-5.6.22-1.fc20.x86_64

OKならmysqlサービス開始。
気をつけることは、Fedora15、CentOS7からはサービスはsystemdで管理されているため、
/etc/init.d/mysqld start ではなくsystemctl start mysqld.service で開始すること。

# systemctl start mysqld.service 

$ mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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.

これで完了