![](https://csdnimg.cn/release/download_crawler_static/89647466/bg1.jpg)
1.卸载系统自带的 mariadb-lib
查看 mariadb 版本
rpm -qa | grep mariadb
卸载 mariadb
rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
重启机器
reboot
2.上传安装包并解压
将 mysql-8.0.18-1.el8.x86_64.rpm-bundle.tar 安装包上传到/opt/software 目录
解压 mysql 安装包到/opt/server 目录
tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar -C /opt/server
3.按顺序安装
必须安装(注意顺序)
rpm -ivh mysql-community-common-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm
非必要安装(注意顺序)
rpm -ivh mysql-community-libs-compat-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-embedded-compat-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-test-8.0.13-1.el7.x86_64.rpm