安装mysql 5.6.4
下载源码
安装cmake
sudo apt-get install cmake
进入mysql源码包:
创建mysql用户与用户组 groupadd mysql useradd mysql -g mysql cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLE_DOWNLOADS=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock -DMYSQL_USER=mysql make make install cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf chown -R mysql:mysql /usr/local/mysql chown mysql:mysql /etc/my.cnf
下载coreseek(sphinx的改进版,内置了mmseg分词)
安装mmseg:
cd mmseg-3.2.14
./configure --prefix=/usr/local/mmseg
如果出现:
config.status: WARNING: ‘Makefile.in‘ seems to ignore the --datarootdir setting
config.status: error: cannot find input file: src/Makefile.in
则需要执行:
sudo apt-get install libtool aclocal libtoolize --force automake --add-missing autoconf autoheader make clean
安装sphinx
cd cd ../csft-4.1/ ./configure --prefix=/usr/local/sphinx --with-mmseg=/usr/local/mmseg --with-mmseg-includes=/usr/local/mmseg/include/mmseg --with-mmseg-libs=/usr/local/mmseg/lib --with-mysql=/usr/local/mysql55 --with-mysql-includes=/usr/local/mysql55/include --with-mysql-libs=/usr/local/mysql55/lib
修改配置文件
生成索引
搜索测试