Quantcast
Channel: Tutorials — LowEndTalk
Viewing all articles
Browse latest Browse all 368

[GUIDE/SCRIPT] MySQL 5.5.23 + Sphinx 2.0.4

$
0
0

After it took me weeks, if not months, to figure out how to do it correctly here is a guide (well, script) to do it. (DEBIAN 6 ONLY - DO NOT SIMPLY RUN THIS - READ AND EDIT)

groupadd mysql
useradd -r -g mysql mysql
echo "deb http://packages.dotdeb.org stable all" >> /etc/apt/sources.list
echo "deb-src http://packages.dotdeb.org stable all" >> /etc/apt/sources.list
wget http://www.dotdeb.org/dotdeb.gpg && cat dotdeb.gpg | apt-key add - && rm dotdeb.gpg
apt-get update
apt-get install libncurses5-dev unzip screen -y
apt-get build-dep mysql-server-5.5 -y
apt-get source mysql-server-5.5 -y
wget http://sphinxsearch.com/files/sphinx-2.0.4-release.tar.gz
wget "http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.23.tar.gz/from/http://mirror.leaseweb.com/mysql/" -O mysql-5.5.23.tar.gz
tar -xvzf mysql-5.5.23.tar.gz
tar -xvzf sphinx-2.0.4-release.tar.gz
rm *.tar.gz
rm mysql-5.5_5.5.23-1~dotdeb.0.dsc
mv mysql-5.5.23 mysql-5.5.23-ORG
cp -a mysql-5.5.23-ORG/Docs mysql-5.5-5.5.23/
cp -R /root/sphinx-2.0.4-release/mysqlse /root/mysql-5.5-5.5.23/storage/sphinx
cd mysql-5.5-5.5.23/
sh BUILD/autorun.sh
./configure --build=x86_64-linux-gnu --host=x86_64-linux-gnu --prefix=/usr --exec-prefix=/usr --libexecdir=/usr/sbin --datadir=/usr/share --localstatedir=/var/lib/mysql --includedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --with-server-suffix="williams-finest-blent" --with-comment="(Debian6)" --with-system-type="debian-linux-gnu" --enable-shared --enable-thread-safe-client --enable-assembler --enable-local-infile --with-pstack --with-fast-mutexes --with-big-tables --with-unix-socket-path=/var/run/mysqld/mysqld.sock --with-mysqld-user=mysql --with-libwrap --without-readline --with-ssl --without-docs --with-extra-charsets=all --without-ndbcluster --with-embedded-server --with-embedded-privilege-control
make
make install
make install scripts
mkdir /etc/mysql
cd /etc/mysql/
######add my.cnf download/creation here######
cd
######download mysql dumps and sphinx config here if available######
cd sphinx-2.0.4-release/
apt-get install libmysqlclient-dev -y
./configure
make
make install
cd /usr/local/etc/
cp /root/sphinx.conf sphinx.conf
mkdir /var/data/
mkdir /var/data/sphinx/
mkdir /var/lib/mysql/
mkdir /var/run/mysqld/
chown -R mysql:mysql /var/run/mysqld/
mkdir /usr/share/mysql/
cd /usr/share/mysql/
wget http://fr.edis.at:8080/william/mysqldocs.zip
unzip mysqldocs.zip && rm mysqldocs.zip
chown -R mysql:mysql /var/lib/mysql/
cd /usr/
/usr/scripts/mysql_install_db
/usr/bin/mysqld_safe --skip-grant-tables &
mysql -uroot -hIP mysql
#update user set Password=PASSWORD('NEWPASS') WHERE User='root';
#flush privileges;
for pid in $(ps aux | grep mysql | grep -v grep | awk '{print $2}'); do kill -9 $pid; done
screen -S mysqld
mysqld
#CTRL+AD
mysql -uroot -pNEWPASS mysql
#CREATE USER 'USER'@'%' IDENTIFIED BY 'NEWPASS';
#CREATE USER 'USER'@'mysql' IDENTIFIED BY 'NEWPASS';
#CREATE USER 'USER'@'127.0.0.1' IDENTIFIED BY 'NEWPASS';
#CREATE USER 'USER'@'localhost' IDENTIFIED BY 'NEWPASS';
#create database predb;
#GRANT ALL PRIVILEGES ON *.* TO 'USER'@'%';
#GRANT ALL PRIVILEGES ON *.* TO 'USER'@'mysql';
#GRANT ALL PRIVILEGES ON *.* TO 'USER'@'127.0.0.1';
#GRANT ALL PRIVILEGES ON *.* TO 'USER'@'localhost';
#INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';
#flush privileges;
cd /etc/init.d/
wget -O mysql-sphinx http://fr.edis.at:8080/william/mysqlinit
wget -O searchd http://fr.edis.at:8080/william/searchdinit
chmod +x mysql-sphinx
chmod +x searchd
mkdir /var/log/mysql
mkdir /var/log/sphinx
cd /root
#IMPORT DB
indexer --all --rotate
searchd
/usr/local/bin/indexer --rotate delta

Viewing all articles
Browse latest Browse all 368

Trending Articles