1.下载 MySQL 所需要的安装包
可以去mysql官网下https://dev.mysql.com/downloads/mysql/
或者链接:https://pan.baidu.com/s/1SlwsobJMCDJ_6mK2WMkGtA 提取码:1234
2.卸载掉原先linux系统安装的mariadb数据库
略
3.创建mysql安装目录
mkdir /usr/local/mysql
4.把下载好的安装包- mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar,放入/usr/local/mysql
5.在/usr/local/mysql目录下,通过 tar -xvf mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar 命令解压 tar 包
6.可以在/usr/local/mysql目录查看到如下安装包
[root@localhost pakg]# ls
mysql-8.0.26-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-8.0.26-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.26-1.el7.x86_64.rpm
mysql-community-common-8.0.26-1.el7.x86_64.rpm
mysql-community-devel-8.0.26-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.26-1.el7.x86_64.rpm
mysql-community-libs-8.0.26-1.el7.x86_64.rpm
mysql-community-libs-compat-8.0.26-1.el7.x86_64.rpm
mysql-community-server-8.0.26-1.el7.x86_64.rpm
mysql-community-test-8.0.26-1.el7.x86_64.rpm
7.通过 rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpm --nodeps --force 命令安装 common
8.通过 rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm --nodeps --force 命令安装 libs
9.通过 rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm --nodeps --force 命令安装 client
10.通过rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm --nodeps --force 命令安装 server
#安装期间如果有依赖关系可以先解决依赖关系
11.通过 rpm -qa | grep mysql 命令查看 mysql 的安装包
ok