percona-server-5.5.33 binary Installation

Source: Internet
Author: User
Tags percona percona server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.