写一个用rpm包安装mysql5.7的shell脚本
时间: 2023-05-22 11:03:49 浏览: 115
以下是安装MySQL 5.7的Shell脚本:
#!/bin/bash
# 安装MySQL 5.7的脚本
# 下载并添加MySQL 5.7的yum源
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
# 安装MySQL 5.7
yum install -y mysql-community-server
# 启动并设置MySQL 5.7为开机自启动
systemctl start mysqld.service
systemctl enable mysqld.service
echo "MySQL 5.7 has been installed successfully!"
以上是用rpm包安装MySQL 5.7的Shell脚本,希望能对你有所帮助。
阅读全文