#!/bin/bash
# set environment
yum install lrzsz ntpdate sysstat -y
# isntall mysql
function mysql_install ()
{
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
yum install yum-priorities -y
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/remi-release-16.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum --enablerepo=remi install mysql mysql-server -y
service mysqld start
mysql mysql -e "Delete FROM user Where Host='localhost' and User='';"
mysql mysql -e "Delete FROM user Where Host='';"
mysql mysql -e "Delete FROM user Where User='';"
}
mysql_install >> /home/log/Mysql_install.log