1. 下载发行包
sudo yum localinstall mysql80-community-release-el7-3.noarch.rpm
2. 验证安装
yum repolist enabled | grep "mysql.*-community.*"
3. 设置发布系列
检查mysql8是否为默认发布系列
yum repolist all | grep mysql
如果mysql8不是默认发布系列,则需禁用mysql57-community并启用mysql80-community
使用命令:
sudo yum-config-manager --disable mysql57-community
sudo yum-config-manager --enable mysql80-community
直接编辑文件/etc/yum.repos.d/mysql-community.repo
vi /etc/yum.repos.d/mysql-community.repo
4. 确认mysql8已启用
yum repolist enabled | grep mysql
5. 安装mysql8
sudo yum install mysql-community-server
6. 启动MySQL服务器
sudo service mysqld start
sudo service mysqld status
7. 参考
https://dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.html