安裝mysql 5.6.4mysql
下載源碼sql
安裝cmake測試
sudo apt-get install cmakespa
進入mysql源碼包:code
建立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分詞)blog
安裝mmseg:索引
cd mmseg-3.2.14
./configure --prefix=/usr/local/mmseg
若是出現:get
config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir setting
config.status: error: cannot find input file: src/Makefile.ininput
則須要執行:源碼
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
修改配置文件
生成索引
搜索測試