First, delete Percona server
1. Close Mysqld service mysqld stop, and then remove rm-rf/etc/my.cnf
2. Delete the rm-rf/usr/local/percona-server-5.5.33-rel31.1-566.linux.x86_64 folder
3. Remove the soft link rm-rf/usr/local/mysql
4.chkconfig--del mysqld
Delete Rm-rf/etc/init.d/mysqld
5. Delete MySQL user, and group/usr/sbin/userdel MySQL
6. Remove Environment variables
[email protected] ~]# cat uninstall.sh
#!/bin/bash
/sbin/service mysqld Stop &&
/BIN/RM-RF/ETC/MY.CNF &&
/bin/rm-rf/usr/local/percona-server-5.5.33-rel31.1-566.linux.x86_64 &&
/bin/rm-rf/usr/local/mysql &&
/sbin/chkconfig--del mysqld &&
/bin/rm-rf/etc/init.d/mysqld &&
/usr/sbin/userdel MySQL
Second, automatic installation
Description
1. Copy the binary Percona file: percona-server-5.5.33-rel31.1-566.linux.x86_64.tar.gz to the/usr/local directory
2. Basic directory (Percona unzip file soft connect to/usr/local/mysql):
Mysql_dir= "/usr/local"
Data_dir= "/usr/local/mysql/data"
Base_dir= "/usr/local/mysql"
3. Copy the script to the/root directory, and assign execute permission to execute directly.
4. Need to increase the judgment, whether the installation has MySQL, installed before the direct exit
[email protected] ~]# cat mysqinstall.sh
#!/bin/bash
Mysql_dir= "/usr/local"
Data_dir= "/usr/local/mysql/data"
Base_dir= "/usr/local/mysql"
echo "-------checking MySQL ENV now! Please wait-------"
Username= ' Cat/etc/passwd|grep mysql|cut-c 1-5 '
if [[$username = = "MySQL"]];then
echo "User Check,mysql user already have,can not install mysql!!"
Else
echo "Please input MySQL version:"
Read VERSION
echo "Your MySQL version is percona-server-$VERSION-rel31.1-566.linux.x86_64.tar.gz"
If [-E "$MYSQL _dir/percona-server-$VERSION-rel31.1-566.linux.x86_64.tar.gz"]
Then
echo "Please waitting"
Sleep 3
/usr/sbin/groupadd MySQL &&
/usr/sbin/useradd-r-g MySQL MySQL &&
Tar zxvf $MYSQL _dir/percona-server-$VERSION-rel31.1-566.linux.x86_64.tar.gz-c $MYSQL _dir/&&
CD $MYSQL _dir/percona-server-$VERSION-rel31.1-566.linux.x86_64 &&
echo "path= $PATH: $HOME/bin:/usr/local/mysql/bin" >>/root/.bash_profile && source/root/.bash_profile
Ln-s $MYSQL _dir/percona-server-$VERSION-rel31.1-566.linux.x86_64 $MYSQL _dir/mysql &&
CD $MYSQL _dir/mysql &&
/bin/chown-r MySQL. &&
/bin/chgrp-r MySQL. &&
sh/usr/local/mysql/scripts/mysql_install_db--user=mysql
/bin/chown-r Root. &&
/bin/chown-r MySQL Data
/BIN/CP $BASE _dir/support-files/my-medium.cnf/etc/my.cnf
/BIN/CP $BASE _dir/support-files/mysql.server/etc/init.d/mysqld
/sbin/chkconfig--add mysqld
/sbin/service mysqld Start
Else
echo "Your input MySQL version is not in $MYSQL _dir"
Fi
Fi
percona-server-5.5.33 binary Installation