1.[root@localhost ~]# mkdir /var/xya
2.[root@localhost ~]# mount /dev/cdrom /var/xya
mount: /dev/sr0 写保护,将以只读方式挂载
3.[root@localhost ~]# ls /var/xya
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
4.[root@localhost ~]# rm -rf /etc/yum.repos.d/*.repo
5.[root@localhost ~]# yum-config-manager --add file:///var/xya
已加载插件:fastestmirror, langpacks
adding repo from: file:///var/xya
[var_xya]
name=added from: file:///var/xya
baseurl=file:///var/xya
enabled=1
6.[root@localhost ~]# vim /etc/yum.conf 注:gpgcheck=0
7.[root@localhost ~]# yum clean all
已加载插件:fastestmirror, langpacks
正在清理软件源: var_xya
8.[root@localhost ~]# yum -y install mariadb mariadb-server
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
var_xya | 3.6 kB 00:00:00
(1/2): var_xya/group_gz | 165 kB 00:00:00
(2/2): var_xya/primary_db | 3.2 MB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 mariadb.x86_64.1.5.5.64-1.el7 将被 安装
---> 软件包 mariadb-server.x86_64.1.5.5.64-1.el7 将被 安装
--> 正在处理依赖关系 perl-DBD-MySQL,它被软件包 1:mariadb-server-5.5.64-1.el7.x86_64 需要
--> 正在检查事务
---> 软件包 perl-DBD-MySQL.x86_64.0.4.023-6.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
========================================================================================
Package 架构 版本 源 大小
========================================================================================
正在安装:
mariadb x86_64 1:5.5.64-1.el7 var_xya 8.7 M
mariadb-server x86_64 1:5.5.64-1.el7 var_xya 11 M
为依赖而安装:
perl-DBD-MySQL x86_64 4.023-6.el7 var_xya 140 k
事务概要
========================================================================================
安装 2 软件包 (+1 依赖软件包)
总下载量:20 M
安装大小:107 M
Downloading packages:
----------------------------------------------------------------------------------------
总计 48 MB/s | 20 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : perl-DBD-MySQL-4.023-6.el7.x86_64 1/3
正在安装 : 1:mariadb-5.5.64-1.el7.x86_64 2/3
正在安装 : 1:mariadb-server-5.5.64-1.el7.x86_64 3/3
验证中 : 1:mariadb-5.5.64-1.el7.x86_64 1/3
验证中 : perl-DBD-MySQL-4.023-6.el7.x86_64 2/3
验证中 : 1:mariadb-server-5.5.64-1.el7.x86_64 3/3
已安装:
mariadb.x86_64 1:5.5.64-1.el7 mariadb-server.x86_64 1:5.5.64-1.el7
作为依赖被安装:
perl-DBD-MySQL.x86_64 0:4.023-6.el7
完毕!
9.[root@localhost ~]# yum list mariadb mariadb-server
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
已安装的软件包
mariadb.x86_64 1:5.5.64-1.el7 @var_xya
mariadb-server.x86_64 1:5.5.64-1.el7 @var_xya
10.[root@localhost ~]# systemctl restart mariadb
11.[root@localhost ~]# mysql -uroot -p
Enter password: 注:回车
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.64-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)]>