mysql script install

#!/bin/bash
#Please make sure that your yum is OK .
#Please put two packages (cmake-2.8.5.tar and mysql-5.5.11.tar) in root
cd /root
tar zxvf cmake-2.8.5.tar.gz -C /usr/local/src
mount -a
cd /usr/local/src/cmake-2.8.5
yum install gcc* -y
./configure
make && make install
mkdir -p /data/mysql
groupadd mysql
useradd -r -g mysql -d /data/mysql -s/sbin/nologin mysql
chown -R mysql.mysql /data/mysql
id mysql  &> /dev/null
cd /root
tar zxvf mysql-5.5.11.tar.gz -C /usr/local/src
yum install ncurses-devel -y
cd /usr/local/src/mysql-5.5.11
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5 -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DDEFAULT_COLLATION=utf8_general_ci
make && make install
mv /etc/my.cnf /etc/my.cnf.bak
cd /usr/local/mysql5.5/support-files
cp my-medium.cnf /etc/my.cnf
#cd /usr/local/mysql5.5/support-files
cp mysql.server  /etc/init.d/mysqld
cd /usr/local/mysql5.5/scripts
./mysql_install_db --user=mysql --basedir=/usr/local/mysql5.5 --datadir=/data/mysql
cat << EOF >>/etc/my.cnf
datadir       =/data/mysql
EOF
/etc/init.d/mysqld start
  qq小新958676590


            mysql script install,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。