centos5.4安装配置mysql5.5.8+sphinx0.9.9

#ready:
#download mysql from : http://www.mysql.com/downloads/mirror.php?id=401062#mirrors
$ wget http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.8.tar.gz
$ svn co http://sphinxsearch.googlecode.com/svn/trunk sphinx-trunk
$ wget http://www.coreseek.cn/uploads/csft/patch/Sphinx_1.11-dev_sphinxse_mysql-5.5.8.diff
$ wget http://www.coreseek.cn/uploads/csft/patch/Sphinx_1.11-r2652-dev_sphinxse_mysql-5.5.8.diff
$ tar xzvf mysql-5.5.8.tar.gz

#patch:
$ cd sphinx-trunk
$ patch -p0 < ../Sphinx_1.11-dev_sphinxse_mysql-5.5.8.diff
$ cp -R mysqlse ../mysql-5.5.8/storage/sphinx
$ rm mysqlse/CMakeLists.txt mysqlse/ha_sphinx.cc mysqlse/ha_sphinx.h
$ svn up -r 2652
$ patch -p0 < ../Sphinx_1.11-r2652-dev_sphinxse_mysql-5.5.8.diff
$ cp -R mysqlse ../mysql-5.5.8/storage/sphinx

#build:
$ cd ../mysql-5.5.8
$ cmake . -DCMAKE_BUILD_TYPE=Release -DWITH_SPHINX_STORAGE_ENGINE=1 #可能会提示CMAKE_BUILD_TYPE有问题,去掉略过
$ make
$ make install
$ ls -l storage/sphinx/ha_sphinx.*
#you'll see ha_sphinx.so.
$ cp support-files/mysql.server /etc/init.d/mysqld
$ chmod 755 /etc/init.d/mysqld
$ bash scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/app/mysql/data/
$ /etc/init.d/mysqld start
如果出现: /etc/init.d/mysqld: line 256: my_print_defaults: command not found
Starting MySQLCouldn't find MySQL server (./bin/mysqld_safe[FAILED]
则修改 /etc/init.d/mysqld中或/etc/my.cnf中的basedir和datadir
$ ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
#tip:
#now ,you can run "make install" to install mysql at /usr/local/mysql.
#or , you can copy ha_sphinx.so to the patch lib/plugin/ in your mysql install directory.

#install plugin:
#login mysql with user root
$ mysql
mysql>INSTALL PLUGIN sphinx SONAME "ha_sphinx.so"
mysql>SHOW ENGINES;
#you'll see SPHINX in the ENGINE list.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注


*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>