LoginSignup
2
1

More than 5 years have passed since last update.

mysql5.6のclientだけインストール@CentOS6.6

Last updated at Posted at 2015-02-04

rpmで入れるとnot relocateableだけど、
インストール先を指定したいので、cmakeを使ってソースからコンパイルして入れる

使用するソース・ファイルは下記からDLする。
http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz

コンパイル環境を整える

# yum -y install gcc-c++
Installed:
  gcc-c++.x86_64 0:4.4.7-11.el6                                                                                                                                                     

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6               cpp.x86_64 0:4.4.7-11.el6                        gcc.x86_64 0:4.4.7-11.el6           glibc-devel.x86_64 0:2.12-1.149.el6_6.5      
  glibc-headers.x86_64 0:2.12-1.149.el6_6.5       kernel-headers.x86_64 0:2.6.32-504.8.1.el6       libgomp.x86_64 0:4.4.7-11.el6       libstdc++-devel.x86_64 0:4.4.7-11.el6        
  mpfr.x86_64 0:2.4.1-6.el6                       ppl.x86_64 0:0.10.2-11.el6                      

Complete!
# yum -y install cmake
 Installed:
  bison.x86_64 0:2.4.1-5.el6                                                                                                                                                        

Dependency Installed:
  m4.x86_64 0:1.4.13-5.el6                                                                                                                                                          

Complete!
# yum -y install ncurses-devel
Installed:
  ncurses-devel.x86_64 0:5.7-3.20090208.el6                                                                                                                                         

Complete!

アーカイブダウンロード

# cd /tmp
# wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz

アーカイブファイル解凍

# tar zxvf mysql-5.6.23.tar.gz

Cmakeする

# cd mysql-5.6.23

# cmake -DCMAKE_INSTALL_PREFIX=/sb/mysql/mysql5.6 -DWITHOUT_SERVER=ON -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci .


〜中略〜
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/source/mysql-5.6.23

-DCMAKE_INSTALL_PREFIXでインストール先指定
-DWITHOUT_SERVER=ONでクライアントだけに指定
-DDEFAULT_CHARSETでキャラセット指定(クライアントだけだといらないかも)
-DDEFAULT_COLLATIONでコレーション指定(クライアントだけだといらないかも)
その他のオプションは下記参照
http://dev.mysql.com/doc/mysql-sourcebuild-excerpt/5.5/en/source-configuration-options.html#option_cmake_cmake_install_prefix

makeする

# make
〜中略〜
Linking C static library libmysqlservices.a
[100%] Built target mysqlservices

インストールする

# make install
〜中略〜
-- Installing: /sb/mysql/mysql5.6/bin/mysql_find_rows
-- Installing: /sb/mysql/mysql5.6/bin/mysqlhotcopy
-- Installing: /sb/mysql/mysql5.6/bin/mysqldumpslow
-- Installing: /sb/mysql/mysql5.6/bin/mysqld_multi
-- Installing: /sb/mysql/mysql5.6/bin/mysqld_safe
-- Installing: /sb/mysql/mysql5.6/bin/mysql_secure_installation

お掃除

# rm -rf CMakeCache.txt
# make clean

おまけ〜アンインストール〜

# xargs rm < install_manifest.txt 

動作確認

# /sb/mysql/mysql5.6/bin/mysql --version
/sb/mysql/mysql5.6/bin/mysql  Ver 14.14 Distrib 5.6.23, 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