From 364a3d13204782ec220f8aa7c4713418be82390f Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 Apr 2024 05:20:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/get-mysql.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/get-mysql.sh b/os/get-mysql.sh index d6360fb..429d06c 100644 --- a/os/get-mysql.sh +++ b/os/get-mysql.sh @@ -39,12 +39,14 @@ else fi if [ -z "$level" ];then echo -e "使用此脚本:curl https://gitea.beyourself.org.cn/newrain001/shell-project/raw/branch/master/os/get-mysql.sh | level=5.7 sh\n版本号可选 5.6 5.7 8.0" + exit elif [ "$level" == "5.7" ];then yum -y install mysql-community-server mysql-community-devel --disablerepo mysql80-community --enablerepo mysql57-community --nogpgcheck elif [ "$level" == "8.0" ];then yum install -y mysql-community-server --nogpgcheck elif [ "$level" == "5.6" ];then yum -y install mysql-community-server mysql-community-devel --disablerepo mysql80-community --enablerepo mysql56-community --nogpgcheck +fi systemctl start mysqld color Warning "启动成功,初始密码如下(mysql5.7前版本没有初始密码)" passwd=$(grep -o 'root@localhost.*' /var/log/mysqld.log | awk 'END{print $NF}')