安装sphinx(一)

1.   下载 sphinx  

[root@localhost ~]# cd  /usr/local/src

wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz -c 

wget  http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.51.tar.gz   -c

解压:

tar  zxvf  sphinx-0.9.9.tar.gz 

tar zxvf  mysql-5.1.51.tar.gz 

mkdir  /usr/local/src/mysql-5.1.51/storage/sphinx

cp /usr/local/src/sphinx-0.9.9/mysqlse/*  /usr/local/src/mysql-5.1.51/storage/sphinx/

 

进入MYSQL 编译安装MYSQL

cd  mysql-5.1.51

mkdir  /usr/local/mysql

yum  -y  install   gcc gcc-c++    

./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charset=all --enable-thread-safe-client --enable-assembler --with-readline --with-big-tables --with-named-curses-libs=/usr/lib64/libncursesw.so.5  --with-plugins=sphinx 

 

出现错误:

configure: error: unknown plugin: sphinx

 首先安装:

 yum  -y install  imake  automake  libtool

 

然后  

 sh  BUILD/cleanup 

 sh  BUILD/autorun.sh 

 

然后再编译:

 ./configure  -h

 

底部出现:

   === Sphinx Storage Engine ===
  Plugin Name:      sphinx
  Description:      Sphinx Storage Engines
  Supports build:   static and dynamic
  Configurations:   max, max-no-ndb 

 

 

然后重新编译MYSQL

  ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charset=all --enable-thread-safe-client --enable-assembler --with-readline --with-big-tables --with-named-curses-libs=/usr/lib64/libncursesw.so.5  --with-plugins=sphinx 

 

 

make  &&  make install 

 

[root@localhost mysql-5.1.51]# groupadd mysql  

[root@localhost mysql-5.1.51]# useradd  -g mysql mysql

[root@localhost mysql-5.1.51]# chown  -R root:mysql   /usr/local/mysql/

 

 /usr/local/mysql/bin/mysql_install_db   --user=mysql  --datadir=/usr/local/mysql/var

 

[root@localhost mysql-5.1.51]# chown  -R mysql /usr/local/mysql/var

 

[root@localhost mysql-5.1.51]# cp  support-files/mysql.server   /etc/init.d/

[root@localhost mysql-5.1.51]# chmod  700  /etc/init.d/mysql.server 

[root@localhost mysql-5.1.51]# cp support-files/my-medium.cnf  /etc/my.cnf

[root@localhost mysql-5.1.51]# /etc/init.d/mysql.server  start

shell> vi ~/.bash_profile
修改PATH变量:
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/
让修改马上生效,可以执行如下命令:source ~/.bash_profile 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值