标签:
#! /bin/bash
dir=/usr/local
cd $dir
my=`rpm -qa|grep -i mysql`
if [ ! -z $my ];then
rpm -e $my --nodeps
fi
groupadd mysql;useradd -r -g mysql mysql
cp -r /opt/bao/mysql-5.5.46-linux2.6-x86_64.tar.gz /usr/local/
tar -xvzf mysql-5.5.46-linux2.6-x86_64.tar.gz
sleep 5
rm -rf mysql-5.5.46-linux2.6-x86_64.tar.gz
ln -s mysql-5.5.46-linux2.6-x86_64 mysql
cd mysql; chown -R mysql:mysql .
scripts/mysql_install_db --user=mysql
sleep 5
chown -R root . ; chown -R mysql data
rm -rf /etc/my.cnf cp
support-files/my-medium.cnf /etc/my.cnf
rm -rf /etc/inti.d/mysqld
cp support-files/mysql.server /etc/init.d/mysqld
标签:
原文地址:http://www.cnblogs.com/perTest/p/5617702.html