Home >Database >Mysql Tutorial >sphinx教程1__mysql sphinx引擎插件式热安装_MySQL

sphinx教程1__mysql sphinx引擎插件式热安装_MySQL

WBOY
WBOYOriginal
2016-06-01 13:07:421048browse

在企业引入搜索功能的时候,很多情况下都能用上sphinx引擎+mysql来处理,通常这个时候Mysql已经在线上了,没办法重新编译安装然后上线,这个时候就需要通过插件的方式来热安装sphinx

环境linux+mysql5.5.32+sphinx-2.1.6


1、查看当前运行的mysql版本 

mysqldump --version

我的Mysql版本5.5.32

2、下载对应的mysql 5.5.32 (版本号一定不能错,要不安装不成功)源码,并解压

下载地址:http://downloads.mysql.com/archives/community/

3、下载shpinx 2.1.6源码,并解压

下载地址 : http://sphinxsearch.com/downloads/archive/

4、将sphinx目录下mysqlse/下所有文件拷贝到mysql目录的storage/sphinx/下

5、编译mysql

cd mysql-5.5.32
sh BUILD/autorun.sh 
./configure 
make

注意:这里到make这步即可,不用install 

6、拷贝编译好的shpinx引擎插件ha_sphinx.so到mysql的插件目录

cp mysql-5.5.32/storage/sphinx/ha_sphinx.so /usr/lib/mysql/plugin/


7、登陆Mysql

/usr/local/mysql/bin/mysql -u root -p -h localhost


8、安装shpinx引擎

mysql> INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so'; 

mysql> show engines;

如果在show engines的结果中看到sphinx就说明安装成功了


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn