#!/bin/sh
yum install -y make apr* autoconf automake curl-devel gcc gcc-c++ gtk+-devel zlib-devel openssl openssl-devel pcre-devel gd gettext gettext-devel kernel keyutils patch perl kernel-headers compat* mpfr cpp glibc libgomp libstdc++-devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype freetype-devel freetype* fontconfig fontconfig-devel libjpeg* libpng* php-common php-gd ncurses* libtool* libxml2 libxml2-devel patch
cp -r Packages/* /usr/local/src
cd /usr/local/src
tar zxvf cmake-2.8.9.tar.gz
cd cmake-2.8.9
./configure
make
make install
/sbin/ldconfig
groupadd mysql
useradd -g mysql mysql -s /bin/false
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql
mkdir -p /usr/local/mysql
cd /usr/local/src
tar zxvf mysql-5.6.10.tar.gz
cd mysql-5.6.10
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc
make
make install
cd /usr/local/mysql
\cp ./support-files/my-huge.cnf /etc/my.cnf
sed -e '/\[mysqld\]/a\datadir = /data/mysql' /etc/my.cnf > tmp;mv -f tmp /etc/my.cnf
./scripts/mysql_install_db --user=mysql
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chkconfig mysqld on
echo 'basedir=/usr/local/mysql/' >> /etc/rc.d/init.d/mysqld
echo 'datadir=/data/mysql/' >>/etc/rc.d/init.d/mysqld
service mysqld start
echo 'export PATH=$PATH:/usr/local/mysql/bin' >> /etc/profile
source /etc/profile
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
阅读(3279) | 评论(0) | 转发(0) |