yum -y install wget
yum -y install vim
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
sed -ri '21c\enabled=1' /etc/yum.repos.d/mysql-community.repo
sed -ri '22c\gpgcheck=0' /etc/yum.repos.d/mysql-community.repo
sed -ri '28c\enabled=0' /etc/yum.repos.d/mysql-community.repo
sed -ri '29c\gpgcheck=1' /etc/yum.repos.d/mysql-community.repo
sed -ri s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config && setenforce 0
systemctl stop firewalld && systemctl disable firewalld
yum install -y mysql-community-server
systemctl start mysqld
systemctl enable mysqld
echo "主人您的密码是:`grep password /var/log/mysqld.log | awk 'NR{print $NF}'`"
YUM安装MySQL5.7脚本
于 2023-10-16 15:04:42 首次发布