先去官网下载sphinx引擎包
我下载的是sphinx-2.2.6-release.tar.gz
tar -zxf sphinx-2.2.6-release.tar.gz
下载mysql源码包(注意要与当前的mysql版本相同)
tar -zxf mysql-5.6.19.tar.gz
在解压的mysql目录中创建sphinx目录
路径是mysql-5.6.19/storage/sphinx
把sphinx-2.2.6包里mysqlse下的文件cp到mysql-5.6.19/storage/sphinx
进入mysql-5.6.19
cd mysql-5.6.19
#sh BUILD/autorun.sh
#./configure
如果出现- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)CMake Error at cmake/readline.cmake:82 (MESSAGE): Curses library not found. Please install appropriate package……
请yum install ncurses-devel
再删除刚才编译生成的 CMakeCache.txt 文件
再执行#./configure
然后make(只是make不要install)
将make好的文件复制到mysql的目录中
cp storage/sphinx/.libs/ha_sphinx.* /usr/local/mysql/lib/plugin
然后把复制的文件更改属主属组
登陆mysql
加载sphinx存储模块
mysql> INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';
查看引擎模块是否正常加载
mysql> show engines;
如需卸载请在mysql中执行
mysql> UNINSTALL PLUGIN sphinx;