1 安装MySQL yum源
# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
# yum install mysql80-community-release-el7-3.noarch.rpm
2 安装MySQL
# yum install mysql-community-server
3 启动MySQL
# service mysqld start
查看是否启动成功
# ps -ef | grep mysql
4 进入MySQL数据库
查看mysql root用户密码
# grep 'temporary password' /var/log/mysqld.log
进入数据库
# mysql -uroot -p
# 输入密码
5 MySQL服务启动、停止、重启
# service mysqld start
# service mysqld stop
# service mysqld restart