CentsOS 7.3无外网环境下安装MySQL 5.7.20

由于工作需要,需要在一台装有 CentOS 系统的测试服务器上安装 MySQL ,由于该服务器上存有其他比较重要的测试数据,所以不能连接外网。由于之前安装 MySQL 一直都是使用 yum 命令一键搞定的,所以手动安装的话还是有些麻烦的。所以在这里我将我在安装过程中遇到的一些问题记录下来。

1.需求就不用讲了,客户现场,政府环境,银行环境,大多是没网的,所以无网安装是很有必要的

mysql下载路径:https://dev.mysql.com/downloads/mysql/

CentsOS 7.3无外网环境下安装MySQL 5.7.20

查看自己Linux系统版本

[root@linuxidc ~]# cat /etc/RedHat-release

CentOS Linux release 7.3.1611 (Core)

往下拉继续选择

CentsOS 7.3无外网环境下安装MySQL 5.7.20

选择对应的下载,mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar

这样几分钟就下载了。

2.准备依赖包:

a.numactl 软件包:

numactl-2.0.9-6.el7_2.x86_64.rpm

numactl-devel-2.0.9-6.el7_2.x86_64.rpm

numactl-libs-2.0.9-6.el7_2.x86_64.rpm

b.其他相关支持:

perl-Data-Dumper-2.145-3.el7.x86_64.rpm

libaio-0.3.109-13.el7.x86_64.rpm

下载方式:https://pkgs.org

CentsOS 7.3无外网环境下安装MySQL 5.7.20

下面是下载路径:

libaio-0.3.109-13.el7.x86_64.rpm

perl-Data-Dumper-2.145-3.el7.x86_64.rpm

numactl-libs-2.0.9-6.el7_2.x86_64.rpm

numactl-devel-2.0.9-6.el7_2.x86_64.rpm

numactl-2.0.9-6.el7_2.x86_64.rpm

3.上传文件到服务器上

localhost:Downloads kylin$ scp -r numactl-2.0.9-6.el7_2.x86_64.rpm root@linuxidc:/root/

root@linuxidc's password:

numactl-2.0.9-6.el7_2.x86_64.rpm              100%  65KB  2.1MB/s  00:00   

localhost:Downloads kylin$ scp -r numactl-libs-2.0.9-6.el7_2.x86_64.rpm root@linuxidc:/root/

root@linuxidc's password:

numactl-libs-2.0.9-6.el7_2.x86_64.rpm        100%  29KB  1.7MB/s  00:00   

localhost:Downloads kylin$ scp -r numactl-devel-2.0.9-6.el7_2.x86_64.rpm root@linuxidc:/root/

root@linuxidc's password:

numactl-devel-2.0.9-6.el7_2.x86_64.rpm        100%  23KB  1.5MB/s  00:00   

localhost:Downloads kylin$ scp -r perl-Data-Dumper-2.145-3.el7.x86_64.rpm root@linuxidc:/root/

root@linuxidc's password:

perl-Data-Dumper-2.145-3.el7.x86_64.rpm      100%  47KB  1.2MB/s  00:00   

localhost:Downloads kylin$ scp -r libaio-0.3.109-13.el7.x86_64.rpm root@linuxidc:/root/

root@linuxidc's password:

Permission denied, please try again.

root@linuxidc's password:

libaio-0.3.109-13.el7.x86_64.rpm              100%  24KB 618.3KB/s  00:00   

localhost:Downloads kylin$ scp -r mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar root@linuxidc:/root/

root@linuxidc's password:

mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar                    100%  566MB  4.5MB/s  02:05

查看上传的包

[root@linuxidc ~]# ls

anaconda-ks.cfg                          numactl-devel-2.0.9-6.el7_2.x86_64.rpm

libaio-0.3.109-13.el7.x86_64.rpm          numactl-libs-2.0.9-6.el7_2.x86_64.rpm

miniconda2                                perl-Data-Dumper-2.145-3.el7.x86_64.rpm

mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar  Pythonshell

numactl-2.0.9-6.el7_2.x86_64.rpm

4.安装

第一步,先安装依赖,安装 perl-Data-Dumper-2.145-3.el7.x86_64.rpm 和 libaio-0.3.109-13.el7.x86_64.rpm

[root@linuxidc ~]# rpm -ivh libaio-0.3.109-13.el7.x86_64.rpm

Preparing...                          ################################# [100%]

    package libaio-0.3.109-13.el7.x86_64 is already installed

[root@linuxidc ~]# rpm -ivh perl-Data-Dumper-2.145-3.el7.x86_64.rpm

Preparing...                          ################################# [100%]

Updating / installing...

   1:perl-Data-Dumper-2.145-3.el7    ################################# [100%]

第二步,继续安装 numactl相关

[root@linuxidc ~]# rpm -ivh numactl*

Preparing...                          ################################# [100%]

    package numactl-libs-2.0.9-6.el7_2.x86_64 is already installed

如果不安装这个包会报错,错误如下(本人未测试):

error: Failed dependencies:

  

libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.18-1.el7.x86_64

  

libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.18-1.el7.x86_64

  

libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.18-1.el7.x86_64 

若此时直接安装mysql,还会异常:

warning: mysql-community-libs-5.7.18-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies:

 mysql-community-common(x86-64) >= 5.7.9 is needed by mysql-community-libs-5.7.18-1.el7.x86_64

 mariadb-libs is obsoleted by mysql-community-libs-5.7.18-1.el7.x86_64

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/cdf0caa3e0c262af69a361ca90c9e3b1.html