I recently started to learn PHP. Many books contain MySQL, So I deployed MySQL. In fact, I found that MySQL was transferred to the cmake platform... now let's share my script...
echo "========================================================================="echo "mysql install shell script for CentOS/RadHat Written by Qzi"echo "creatred in 2012/3/5"echo "last modified in 2012/3/6"echo "Email : hotseason007@gmail.com"echo "========================================================================="echo "========================================================================="echo "MySQL Version: 5.5.21"echo "========================================================================="o "============================mysql install=================================="LNPP_ROOT=/tmp/lnpp/lnpp-0.05MYSQL_VERSION=mysql-5.5.21MYSQL_ROOT=$LNPP_ROOT/mysql/$MYSQL_VERSIONif [ -d $MYSQL_VERSION.tar.gz ]; thenecho "$MYSQL_VERSION.tar.gz is [found]"else#wget -c http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.21.tar.gz echo ""fiif [ -d cmake-2.8.7.tar.gz ]; thenecho "cmake-2.8.7.tar.gz is [found]"else#wget -c http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz echo ""fimkdir -p $LNPP_ROOT/cmake/cmake-2.8.7tar -zxvf cmake-2.8.7.tar.gzcd cmake-2.8.7./bootstrap --prefix=$LNPP_ROOT/cmake/cmake-2.8.7make make install cd ../mkdir -p $MYSQL_ROOT/etcmkdir -p $MYSQL_ROOT/datatar -zxvf $MYSQL_VERSION.tar.gzcd $MYSQL_VERSION$LNPP_ROOT/cmake/cmake-2.8.7/bin/cmake \-DCMAKE_INSTALL_PREFIX=$MYSQL_ROOT \ -DMYSQL_DATADIR=$MYSQL_ROOT/data \-DSYSCONFDIR=$MYSQL_ROOT/etc \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DENABLED_LOCAL_INFILE=1 \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DEXTRA_CHARSETS=all \ #-DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306makemake installif [ $(id -nu mysql) = "mysql" ]; then echo "user mysql is found ... " else echo "creating the user called 'mysql'" su - -c "useradd -M mysql"ficp support-files/my-small.cnf $MYSQL_ROOT/etc/my.cnfchmod 755 $MYSQL_ROOT/scripts/mysql_install_db$MYSQL_ROOT/scripts/mysql_install_db --user=mysql --basedir=$MYSQL_ROOT --datadir=$MYSQL_ROOT/data#chmod +x /etc/init.d/mysqld#cp support-files/mysql.server /etc/init.d/mysqldecho "============================mysql install=================================="
Configuration:
# Vim $ mysql_root/etc/My. CNF
[Mysqld]
Basedir =/tmp/lnpp/lnpp-0.05/MySQL/mysql-5.5.21
Start
# $ Mysql_root/support-files/MySQL. Server start
$ Mysql_root/bin/mysqld_safe -- user = MySQL -- basedir = $ mysql_root -- datadir = $ mysql_root/Data
Disable
Killall mysqld
When PHP is compiled into MySQL for support, add the following options:
-- With-mysql = dir
-- With-PDO-mysql = dir
We have established a Linux + PHP Group. Welcome to join us (QQ Group No.: 213572677)