If you want to installSphinxFull-text search engine), but you do not want to re-compile and installMySQL databaseWhat should I do? The answer is that if your mysql version is 5.0.45 or above, you will not need to re-compile and install it. If your mysql version is earlier than 5.0, you will have to re-compile and install it. To install the storage engine of sphinx in the existing mysql, ensure that the existing mysql runs properly. Mysql does support online hot swapping of storage engines. The following describes the installation steps:
Note: The version of the mysql source code package must be consistent with the current mysql version!
First download the sphinx plug-in package, I am running a mysql-5.1.48
Download: Sphget: wget http://sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz
Extract: Tar-xzvf sphinx-0.9.9.tar.gz
Create a sphinx Folder:
- mkdir mysql-5.1.48/storage/sphinx
Copy all files under mysqlse under the sphscripts directory to the storage/sphinx directory of mysql:
- cp -r sphinx-0.9.9/mysqlse/ mysql-5.1.48/storage/sphinx
Go to the extract directory of the mysql source package:
- cd mysql-5.1.48
-
- sh BUILD/autorun.sh
-
- ./configure
-
- make
Note: Here, make is the step. You do not need to install it.
Copy the make file to the currently running mysql directory:
- cp storage/sphinx/.libs/ha_sphinx.* /usr/local/mysql/lib/plugin
Change owner:
- chown mysql.mysql /usr/local/mysql/lib/plugin/*
Log onto mysql to load the sphinx engine module:
- /usr/local/mysql/bin/mysql -u root -p -h localhost
Load the sphinx storage module:
- mysql> INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';
Check whether the engine module is loaded properly:
- mysql> show engines;
Installation complete! To uninstall the storage module, use:
- mysql> UNINSTALL PLUGIN sphinx;
You can uninstall it.
This article introduces how to install sphinx on MySQL. I hope this article will help you. Thank you!