一、官方YUM安装
官方YUM安装指引:A Quick Guide to Using the MySQL Yum Repository
1.添加MySQL Yum库(以RHEL7安装mysql5.7为例)
shell> sudo rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
2.选择安装的版本
查看可安装的版本
shell> yum repolist all | grep mysql
3.安装MySQL
shell> sudo yum install mysql-community-server
4.启动MySQL
使用service启动
shell> sudo service mysqld start
使用systemctl启动
shell> sudo systemctl start mysqld.service
检查mysql状态
shell> sudo service mysqld status
使用systemctl检查mysql状态
shell> sudo systemctl status mysqld.service