炒饭 2012-08-11
源码下载
wget http://admin.ooopic.com/soft/linux/cmake-2.8.3.tar.gz wget http://www.wapm.cn/uploads/csft/4.0/coreseek-4.0.1-beta.tar.gz wget http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.9.tar.gz
提示:安装5.5.9版本的mysql与前版本的安装方法不同,同时要用到cmake工具。默认安装到/usr/local/mysql路径,安装后更改即可。
安装CMake
tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3 ./bootstrap make make install 安装MYSQL tar xzvf coreseek-4.0.1.tar.gz tar xzvf mysql-VERSION.tar.gz #将sphinx引擎源码拷贝到mysql源码包storage目录下 cp -R coreseek-4.0.1/csft-4.0.1/mysqlse mysql-5.5.9/storage/sphinx cd mysql-5.5.9 cmake . -DCMAKE_BUILD_TYPE=Release -DWITH_SPHINX_STORAGE_ENGINE=1 make #make中途会显示一下信息 Scanning dependencies of target sphinx [ 30%] Building CXX object storage/sphinx/CMakeFiles/sphinx.dir/ha_sphinx.cc.o Linking CXX shared module ha_sphinx.so [ 30%] Built target sphinx make install cd /usr/local/mysql mkdir -p /var/log/mysql /usr/local/mysql/etc cp support-files/my-medium.cnf /usr/local/mysql/etc/my.cnf
编译/etc/my.cnf,加入以下配置 basedir = /usr/local/mysql #mysql所在的位置 datadir = /usr/local/mysql/data #mysql数据库文件存放的路径
chown -R mysql:mysql /usr/local/mysql /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --user=mysql ./bin/mysqld_safe --defaults-extra-file=/usr/local/mysql/etc/my.cnf --user=mysql & mysql -uroot -p mysql>install plugin sphinx soname "ha_sphinx.so"; mysql>show engines; #ENGINE列表显示出SPHINX表示安装成功,包括innodb,MyISAM