[root@localhost mysql-5.1.51]# ldconfig /usr/local/mysql/lib/mysql/
[root@localhost mysql-5.1.51]# ldconfig /usr/local/mysql/include/mysql
[root@localhost mysql-5.1.51]# cd ..
[root@localhost src]# ls
mysql-5.1.51 mysql-5.1.51.tar.gz sphinx-0.9.9 sphinx-0.9.9.tar.gz
[root@localhost src]# cd sphinx-0.9.9
[root@localhost sphinx-0.9.9]# mkdir /usr/local/sphinx
[root@localhost sphinx-0.9.9]# ./configure --prefix=/usr/local/sphinx/ --with-mysql=/usr/local/mysql
[root@localhost sphinx-0.9.9]# make install
[root@localhost sphinx-0.9.9]# cd /usr/local/sphinx/etc
[root@localhost etc]# cp sphinx.conf.dist sphinx.conf
[root@localhost etc]# vim sphinx.conf 对 sphinx 进行配置
[root@localhost etc]# mysql -u mysql </usr/local/sphinx/etc/example.sql
索引建立:
/usr/local/sphinx/bin/indexer
创建索引:
/usr/local/sphinx/bin/indexer --all
测试:
[root@localhost bin]# /usr/local/sphinx/bin/search phrases
安装完成了!