1. wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm 安装 Yum Repository
2.for i in $(rpm -qa|grep MySQL);do rpm -e $i --nodeps;done 查看是否已经安装过 MySQL
3. 更新 yum update
4.yum install MySQL-server , 安装完后会出现 complete!
5. ps -ef | grep MySQL, 查看是否安装成功
6. 登陆 MySQL
MySQL -uroot -p
7. 选择 MySQL 数据库
use MySQL;
8. 查看 MySQL 的运行状态 systemctl status mysqld.service
启动 MySQL systemctl start mysqld.service
重新启动 MySQL systemctl restart mysqld.service
来源: http://www.bubuko.com/infodetail-3456579.html