安装mysql 8 yum源
# rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
禁用所有的mysql repo 库
# sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
安装mysql 8
# yum --enablerepo=mysql80-community install mysql-community-server
启动mysql
# systemctl start mysqld.service
配置开机启动
# systemctl enable mysqld.service