一、准备工作
-
下载rpm
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
-
安装二进制安装包
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
-
进入 /etc/yum.repos.d/ 目录下
cd /etc/yum.repos.d/
二、服务安装
-
执行安装
yum install mysql-server -y
-
启动mysql服务
systemctl start mysqld.service
-
停止mysql服务
systemctl stop mysqld.service
-
重启mysql服务
systemctl restart mysqld.service