MySql脚本
#!/bin/bash A() { file="/root/mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz" if [ ! -f "$file" ]; then echo "mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz does not exist,need Upload it to /root directory" exit 0 else echo "mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz is exist!!!" fi if [ `whoami` != "root" ];then echo "root is no" exit 0 else echo "root is ok" fi a=`cat /etc/redhat-release |awk 'NR==1' | awk -F '[ ]+' '{print $4}'| cut -d . -f 1` if [ $a != "7" ];then echo "centos7.X is no" exit 0 else echo "centos7.X ok" fi } IPtables() { systemctl stop firewalld.service systemctl disable firewalld