Set up Sphinx in Linux
First download the mysql and sphinx source code packages
Decompress sphinx:
> Tar zxvf sphinx-2.0.6-release.tar.gz
Decompress Mysql
> Tar zxvf mysql-5.1.42.tar.gz
Go to the mysql source code directory, in the mysql-5.1.42/storage directory to create a new sphinx Directory,
Go to the sphinx source code directory and copy all the files under the sphinx-2.0.6-release/mysqlse/directory to mysql-5.1.42/storage/sphinx.
Go to the mysql source code directory and execute the following command
| 123456789 |
> Sh BUILD/autorun. sh # it will execute the automake and autoconf commands to generate Makefile>. /configure -- prefix =/home/admin/mysql-5.1.42 -- with-charset = utf8 -- with-extra-charsets = all -- enable-thread-safe-client -- enable-character er --- readline -- with-big-tables -- with-plugins = sphins> make & make install> cp support-files/my-medium.cnf/etc/my. cnf # Copy the configuration file> cp. /support-files/mysql. server/etc/init. d/mysqld # register server Service> chmod + x/etc/init. d/mysqld> chkconfig mysqld on> service mysql start>/home/admin/mysql-5.1.42/bin/mysql_install_db # install database |
After the execution is complete, no error occurs, indicating that mysql is successfully installed,
Log on to mysql
Run the show engines command to check whether the sphinx engine is successfully installed.
If there is a description, it will be successful!
The next step is to compile and install sphinx.
| 12345 |
# Set the directory for dynamically loading database search.> Ldconfig/home/admin/mysql-5.1.42/lib/mysql> ldconfig/home/admin/mysql-5.1.42/include/mysql>. /configure -- prefix =/home/admin/sphenders-2.0.6 -- with-mysql =/home/admin/mysql-5.1.42> make & make install |
The installation is successful.
In the next chapter, let's take a look at how to use PHP to call the Sphinx service.