首页 > 数据库 >在系统无法上网,也没有光驱镜像文件的环境下安装mysql

在系统无法上网,也没有光驱镜像文件的环境下安装mysql

时间:2022-10-26 19:01:23浏览次数:108  
标签:x86 光驱 server perl 镜像文件 64 mysql mariadb el7

#系统:centos 7 #mysql在centos7当中的安装包名为服务端mariadb-server和客户端mariadb: 第一步:在可联网的centos7系统上新建一个Yum仓库目录 mkdir mariadb-yumrepo



第二步:使用如下命令下载mysql安装所需要的包到yum仓库目录中 yum install --downloadonly --downloaddir=/mariadb-yumrepo mariadb-server mariadb



第三步:通过yum安装创建元数据的索引命令工具createrepo yum install createrepo



第四步:通过createrepo工具为mariadb-yumrepo目录下的服务包建立索引元数据 createrepo /mariadb-yumrepo



第五步:将目录打包,上传到需要安装mysql服务的系统上 tar -zcvf mariadb-yumreop.tar.gz /mariadb-yumrepo



第六步:在需要安装mysql服务的系统上,解压上面打包好的文件, tar -zxvf mariadb-yumreop.tar.gz -C /var/ [root@Centos 7 /]# cd /var/mariadb-yumrepo/ [root@Centos 7 /var/mariadb-yumrepo]# pwd /var/mariadb-yumrepo [root@Centos 7 /var/mariadb-yumrepo]# ls mariadb-5.5.68-1.el7.x86_64.rpm mariadb-server-5.5.68-1.el7.x86_64.rpm perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm perl-Data-Dumper-2.145-3.el7.x86_64.rpm perl-DBD-MySQL-4.023-6.el7.x86_64.rpm perl-DBI-1.627-4.el7.x86_64.rpm perl-IO-Compress-2.061-2.el7.noarch.rpm perl-Net-Daemon-0.48-5.el7.noarch.rpm perl-PlRPC-0.2020-14.el7.noarch.rpm repodata

第七步:根据此目录文件建立本地yum仓库 [root@Centos 7 /var/mariadb-yumrepo]# cd /etc/yum.repos.d/ [root@Centos 7 /etc/yum.repos.d]# vim bendiyum.repo [mariadb-server] name=mysql isntall server baseurl=file:///var/mariadb-yumrepo/ gpgcheck=0 #建立元数据 [root@Centos 7 /etc/yum.repos.d]# yum makecache

第八步:开始安装mysql服务 [root@Centos 7 /etc/yum.repos.d]# yum install mariadb-server mariadb Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package mariadb.x86_64 1:5.5.68-1.el7 will be installed ---> Package mariadb-server.x86_64 1:5.5.68-1.el7 will be installed --> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.68-1.el7.x86_64 --> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.68-1.el7.x86_64 --> Processing Dependency: perl(Data::Dumper) for package: 1:mariadb-server-5.5.68-1.el7.x86_64 --> Processing Dependency: perl(DBI) for package: 1:mariadb-server-5.5.68-1.el7.x86_64 --> Running transaction check ---> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed ---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed --> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64 --> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64 ---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed --> Running transaction check ---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed --> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch --> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch --> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch --> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch --> Running transaction check ---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed --> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch --> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch ---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed --> Running transaction check ---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed ---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================== Package Arch Version Repository Size =================================================================================== Installing: mariadb x86_64 1:5.5.68-1.el7 mariadb-server 8.8 M mariadb-server x86_64 1:5.5.68-1.el7 mariadb-server 11 M Installing for dependencies: perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 mariadb-server 32 k perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 mariadb-server 57 k perl-DBD-MySQL x86_64 4.023-6.el7 mariadb-server 140 k perl-DBI x86_64 1.627-4.el7 mariadb-server 802 k perl-Data-Dumper x86_64 2.145-3.el7 mariadb-server 47 k perl-IO-Compress noarch 2.061-2.el7 mariadb-server 260 k perl-Net-Daemon noarch 0.48-5.el7 mariadb-server 51 k perl-PlRPC noarch 0.2020-14.el7 mariadb-server 36 k Transaction Summary =================================================================================== Install 2 Packages (+8 Dependent packages) Total download size: 21 M Installed size: 110 M Is this ok [y/d/N]: y Downloading packages:


Total 290 MB/s | 21 MB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : perl-Data-Dumper-2.145-3.el7.x86_64 1/10 Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 2/10 Installing : 1:mariadb-5.5.68-1.el7.x86_64 3/10 Installing : perl-Net-Daemon-0.48-5.el7.noarch 4/10 Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 5/10 Installing : perl-IO-Compress-2.061-2.el7.noarch 6/10 Installing : perl-PlRPC-0.2020-14.el7.noarch 7/10 Installing : perl-DBI-1.627-4.el7.x86_64 8/10 Installing : perl-DBD-MySQL-4.023-6.el7.x86_64 9/10 Installing : 1:mariadb-server-5.5.68-1.el7.x86_64 10/10 Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 1/10 Verifying : perl-Net-Daemon-0.48-5.el7.noarch 2/10 Verifying : perl-Data-Dumper-2.145-3.el7.x86_64 3/10 Verifying : 1:mariadb-server-5.5.68-1.el7.x86_64 4/10 Verifying : perl-DBD-MySQL-4.023-6.el7.x86_64 5/10 Verifying : 1:mariadb-5.5.68-1.el7.x86_64 6/10 Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 7/10 Verifying : perl-DBI-1.627-4.el7.x86_64 8/10 Verifying : perl-IO-Compress-2.061-2.el7.noarch 9/10 Verifying : perl-PlRPC-0.2020-14.el7.noarch 10/10 Installed: mariadb.x86_64 1:5.5.68-1.el7 mariadb-server.x86_64 1:5.5.68-1.el7 Dependency Installed: perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBD-MySQL.x86_64 0:4.023-6.el7 perl-DBI.x86_64 0:1.627-4.el7 perl-Data-Dumper.x86_64 0:2.145-3.el7 perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7 Complete!

#启动mysql服务 [root@Centos 7 /etc/yum.repos.d]# systemctl start mariadb.service #查看mysql服务状态 [root@Centos 7 /etc/yum.repos.d]# systemctl status mariadb.service ● mariadb.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled) Active: active (running) since Sat 2022-10-22 23:00:55 CST; 8s ago Process: 4299 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS) Process: 4216 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS) Main PID: 4298 (mysqld_safe) CGroup: /system.slice/mariadb.service ├─4298 /bin/sh /usr/bin/mysqld_safe --basedir=/usr └─4463 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --... Oct 22 23:00:53 Centos 7 mariadb-prepare-db-dir[4216]: MySQL manual for more ins... Oct 22 23:00:53 Centos 7 mariadb-prepare-db-dir[4216]: Please report any problem... Oct 22 23:00:53 Centos 7 mariadb-prepare-db-dir[4216]: The latest information ab... Oct 22 23:00:53 Centos 7 mariadb-prepare-db-dir[4216]: You can find additional i... Oct 22 23:00:53 Centos 7 mariadb-prepare-db-dir[4216]: ​​http://dev.mysql.com​​ Oct 22 23:00:53 Centos 7 mariadb-prepare-db-dir[4216]: Consider joining MariaDB'... Oct 22 23:00:53 Centos 7 mariadb-prepare-db-dir[4216]: ​​https://mariadb.org/get-i​​​​... Oct 22 23:00:53 Centos 7 mysqld_safe[4298]: 221022 23:00:53 mysqld_safe Logging.... Oct 22 23:00:53 Centos 7 mysqld_safe[4298]: 221022 23:00:53 mysqld_safe Startin...l Oct 22 23:00:55 Centos 7 systemd[1]: Started MariaDB database server. Hint: Some lines were ellipsized, use -l to show in full. #访问mysql服务 [root@Centos 7 /etc/yum.repos.d]# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 5.5.68-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> MariaDB [(none)]> show databases; #查看数据库 +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.00 sec) ————————————————

版权声明:本文为CSDN博主「a rookie.」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:​​​https://blog.csdn.net/zhanghongshun624/article/details/127501859​​

标签:x86,光驱,server,perl,镜像文件,64,mysql,mariadb,el7
From: https://blog.51cto.com/u_15793623/5798165

相关文章

  • zk,kafka,redis哨兵,mysql容器化
    1.zookeeper,kafka容器化1.1zookeeper+kafka单机docker模式dockerpullbitnami/zookeeper:3.6.3-debian-11-r46dockerpullbitnami/kafka:3.1.1-debian-11-r36dock......
  • ubuntu下Mysql安装与root密码重置
    一、安装1.首先更新本地存储库索引,执行sudoaptupdate2.从APT存储库安装MySQL,执行sudoaptinstallMySQL-server,在安装过程中,可能会出现[Y/n]问题,输入Y继续3.安装完......
  • mysql学习---简单的数据库初始化脚本和sql分析
    1、创建库、表、权限等DROPDATABASEIFEXISTS`KMS_DB`;CREATEDATABASEIFNOTEXISTS`KMS_DB`CHARACTERSET`utf8`COLLATE`utf8_general_ci`;/*characterset,数......
  • 「MySQL高级篇」MySQL索引原理,设计原则
    大家好,我是melo,一名大二后台练习生,大年初三,我又来充当反内卷第一人了!!!......
  • 第二十二(1)mysql数据库
    数据库概述为什么要使用数据库?那我们在没有学习数据库的时候,数据存放在json或者磁盘文件中不也挺好的嘛,为啥还要学习数据库?文件中存储数据,无法基于文件直接对数据......
  • MySQL优化--NOT EXISTS和LEFT JOIN方式差异
    两种执行方式对比:1、从执行计划来看,两个表都使用了索引,区别在于NOTEXISTS使用“DEPENDENTSUBQUERY”方式,而LEFTJOIN使用普通表关联的方式2、从执行过程来看,LEFTJOIN方......
  • MySQL基础篇--全局缓存和线程缓存
    MySQL全局缓存key_buffer_size决定索引处理的速度,尤其是索引读的速度。默认值是16M,通过检查状态值Key_read_requests和Key_reads,可以知道key_buffer_size设置是否合理。比例......
  • MySQL基础篇--执行计划扫描方式详解
    type列全表扫描ALL在查询结果集在达到全表数据>15-30%,优化器有可能会选择全表。在查询条件中出现隐式转换统计信息过旧,不准确。条件列是函数或者计算。使用ISNULL......
  • Mysql主从复制读写分离
    Mysql主从复制读写分离一.主从复制原理1、主从复制作用和特点1)主从复制的作用保证数据的一致性和完整性2)特点避免数据库单节点故障数据丢失增强可靠性增强稳定性2、主从复制......
  • 【常用方法推荐】如何删除MySQL的重复数据?
    在使用数据库时,出现重复数据是常有的情况,但有些情况是允许数据重复的,而有些情况是不允许的,当出现不允许的情况,我们就需要对重复数据进行删除处理。那么如何删除MySQL的......