CentOS-6.3に mysql-5.5.20 と mroonga-2.04 を入れる方法
mroonga公式のCentOS-6向けパッケージでは、mysql-5.1用しか提供されていません。
しかし事情により、CentOS-6でmysql-5.5系を利用したい方もいると思います。
そんな時に使える、インストール方法を紹介します。
<お知らせ>
mroongaは公開時にセットでリリースされたMySQLバージョン以外の組み合わせとした場合、期待通りの動作となりません。mroongaは日進月歩の進化を遂げているため、「CentOS-6.x に MySQL-5.6.11 と mroonga の最新版を入れる方法」という記事で紹介しております、最新のMySQL 5.6と共に使うmysql56-mroongaを是非ご検討ください。
インストール方法
リポジトリ推奨のmecabを先に入れた後に、mroonga本体をインストールします。
CentOS-6でも問題なく動作します。
$ sudo yum -y install mecab mecab-devel mecab-ipadic --disablerepo=* --enablerepo=groonga $ sudo rpm -ivh http://packages.groonga.org/centos/5/x86_64/Packages/mysql-mroonga-2.04-0.x86_64.rpm \ http://packages.groonga.org/centos/5/x86_64/Packages/MySQL-shared-5.5.25-1.rhel5.x86_64.rpm \ http://packages.groonga.org/centos/5/x86_64/Packages/MySQL-server-5.5.25-1.rhel5.x86_64.rpm \ http://packages.groonga.org/centos/5/x86_64/Packages/MySQL-devel-5.5.25-1.rhel5.x86_64.rpm \ http://packages.groonga.org/centos/5/x86_64/Packages/MySQL-client-5.5.25-1.rhel5.x86_64.rpm
インストール確認
mysql> show engines; +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MyISAM | YES | MyISAM storage engine | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | mroonga | YES | CJK-ready fulltext search, column store | NO | NO | NO | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ 10 rows in set (0.00 sec)
動作テスト
mysql> create table sample_fulltext (id int, content text, primary key(id), fulltext key (content)) engine = mroonga; Query OK, 0 rows affected (0.56 sec) mysql> insert into sample_fulltext (id, content) values (1, 'mroongaとは'), (2, 'Tritonnの後継'), -> (3, 'MySQLのプラグインとして動作'), (4, '更新性能の向上'), (5, '検索性能の向上'); Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> select * from sample_fulltext where match(content) against('性能'); +----+-----------------------+ | id | content | +----+-----------------------+ | 4 | 更新性能の向上 | | 5 | 検索性能の向上 | +----+-----------------------+ 2 rows in set (0.01 sec)
なお、同様の方法で過去のバージョンも動きましたが、今後も同様に動くとは限りません。
このインストール方法は公式の組み合わせではない点、ご承知おき下さい。
更新履歴
2012.07.14 CentOS 6.3向け情報にアップデートしました
2013.05.02 リンクして下さっているブログを関連ブログとして追加