読者です 読者をやめる 読者になる 読者になる

CentOS 5.4(x86_64)にMySQL+Spiderをインストールする

手順がめんどくさかったのでメモしておく。

yum install -y ncurses-devel readline-devel
wget http://storehouse.sakura.ne.jp/RPMS/x86_64/m4-1.4.12-2.x86_64.rpm
wget http://storehouse.sakura.ne.jp/RPMS/noarch/autoconf-2.63-2.noarch.rpm
rpm -Uhv *.rpm
rm *.rpm
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.44.tar.gz
wget http://launchpad.net/spiderformysql/spider-2.x/2.21-for-5.1.44/+download/spider-src-2.21-for-5.1.44.tgz
tar xf mysql-5.1.44.tar.gz
tar xf spider-src-2.21-for-5.1.44.tgz
rm *gz
mv ./spider ./mysql-5.1.44/storage/
cd ./mysql-5.1.44
patch -p2 < ../mysql-5.1.44.spider.diff
autoconf
automake
./configure \
--prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
--libexecdir=/usr/local/mysql/bin \
--enable-thread-safe-client \
--enable-local-infile \
--with-pic \
--with-fast-mutexes \
--with-client-ldflags=-static \
--with-mysqld-ldflags=-static \
--with-zlib-dir=bundled \
--with-big-tables \
--with-ssl \
--with-readline \
--without-embedded-server \
--with-plugins=partition,innobase,innodb_plugin,myisam,csv \
--with-extra-charsets=complex
make
make install
cp ./support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
cd ..
mv ./mysql-5.1.44.spider.diff ./mysql-5.1.44/
mv ./mysql-5.1.44 /usr/local/src/
cd /usr/local/mysql
./bin/mysql_install_db
adduser mysql
chown -R mysql:mysql /usr/local/mysql
cp ./share/mysql/my-medium.cnf /etc/my.cnf
/etc/init.d/mysql start

autoconfとm4は野良ビルドしたパッケージ。

wget http://dl.dropbox.com/u/5700319/spider_files/install_spider.sql
export PATH=$PATH:/usr/local/mysql/bin
mysql
mysql> source install_spider.sql
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| SPIDER     | YES     | Spider storage engine                                      | YES          | YES  | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
6 rows in set (0.00 sec)