###### 二进制自动安装数据库脚本root密码MANAGER将脚本和安装包放在/root目录即可###############
######数据库目录/usr/local/mysql############
######数据目录/data/mysql############
######日志目录/log/mysql############
######端口号默认3306其余参数按需自行修改############
##################
#author:rrhelei@126.com#
##################
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:~/bin
exportPATH
# Checkif user is root
if [ $(id-u) != "0" ]; then
echo "Error: You must be root to runthis script, please use root to install"
exit 1
fi
clear
echo"========================================================================="
echo"A tool to auto-compile & install MySQL 5.6.25 on Redhat/CentOS Linux"
echo"========================================================================="
cur_dir=$(pwd)
#setmysql root password
echo "==========================="
mysqlrootpwd="MANAGER"
echo -e "Please input the root password of mysql:"
read -p "(Default password: MANAGER):" mysqlrootpwd
if [ "$mysqlrootpwd" = "" ]; then
mysqlrootpwd="MANAGER"
fi
echo "==========================="
echo "MySQL root password:$mysqlrootpwd"
echo "==========================="
#whichMySQL Version do you want to install?
e