安装环境:
CentOS 7
mysql-5.7.17.tar.gz
boost_1_59_0.tar.gz
脚本描述:
#!/bin/bash
#一键部署MySQL编译安装
systemctl stop firewalld
systemctl disable firewalld
setenforce 0 &> /dev/null
#检查/opt目录下是否有指定安装包
if [ -e /opt/mysql-5.7.17.tar.gz ];then
continue
if [ -e /opt/boost_1_59_0.tar.gz ];then
continue
else
echo -e '\033[35m /opt目录中没有安装包[boost_1_59_0.tar.gz]\033[0m'
exit
fi
else
echo -e '\033[35m /opt目录中没有安装包[mysql-5.7.17.tar.gz]\033[0m'
exit
fi
#检查依赖包是否安装
if rpm -q gcc gcc-c++ ncurses ncurses-dev