CentOS Linux release 7.5.1804安裝mysql
yum-plugin-fastestmirror-1.1.31-45.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-langpacks-0.4.2-7.el7.noarch
yum-utils-1.1.31-45.el7.noarch
yum-3.4.3-158.el7.centos.noarch
[root@jia ~]# cd /etc/yum.repos.d/
[root@jia yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@jia yum.repos.d]# vi CentOS-Base.repo
[root@jia yum.repos.d]# rm -rf *.repo
[root@jia yum.repos.d]# ls
[root@jia yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2018-06-06 10:25:58-- http://mirrors.163.com/.help/CentOS7-Base-163.repo
正在解析主機 mirrors.163.com (mirrors.163.com)... 59.111.0.251
正在連接 mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... 已連接。
已發出 HTTP 請求,正在等待回應... 200 OK
長度:1572 (1.5K) [application/octet-stream]
正在保存至: “CentOS7-Base-163.repo”
100%[======================================>] 1,572 --.-K/s 用時 0s
2018-06-06 10:25:58 (138 MB/s) - 已保存 “CentOS7-Base-163.repo” [1572/1572])
[root@jia yum.repos.d]# ls
CentOS7-Base-163.repo
[root@jia yum.repos.d]# yum clean all
已加載插件:fastestmirror, langpacks
正在清理軟件源: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned d ata from disabled or removed repos
[root@jia yum.repos.d]# cp CentOS7-Base-163.repo CentOS7-Base-163.repo.bak
[root@jia yum.repos.d]# vi CentOS7-Base-163.repo
[root@jia yum.repos.d]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
[root@jia yum.repos.d]# yum install mysql-server
已加載插件:fastestmirror, langpacks
Determining fastest mirrors
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/4): base/x86_64/group_gz | 166 kB 00:00
(2/4): updates/x86_64/primary_db | 2.0 MB 00:01
(3/4): base/x86_64/primary_db | 5.9 MB 00:04
(4/4): extras/x86_64/primary_db | 147 kB 00:10
沒有可用軟件包 mysql-server。
錯誤:無須任何處理
[root@jia yum.repos.d]# yum -y install wget
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
軟件包 wget-1.14-15.el7_4.1.x86_64 已安裝並且是最新版本
無須任何處理
[root@jia yum.repos.d]# cd /home
[root@jia home]# ls
[root@jia home]# mkdir linshi
c[root@jia home]# cd linshi/
[root@jia linshi]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
--2018-06-06 10:38:42-- http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
正在解析主機 repo.mysql.com (repo.mysql.com)... 23.195.78.58
正在連接 repo.mysql.com (repo.mysql.com)|23.195.78.58|:80... 已連接。
已發出 HTTP 請求,正在等待回應... 200 OK
長度:6140 (6.0K) [application/x-redhat-package-manager]
正在保存至: “mysql-community-release-el7-5.noarch.rpm”
100%[======================================>] 6,140 --.-K/s 用時 0s
2018-06-06 10:38:42 (500 MB/s) - 已保存 “mysql-community-release-el7-5.noarch.rp m” [6140/6140])
[root@jia linshi]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
準備中... ################################# [100%]
正在升級/安裝...
1:mysql-community-release-el7-5 ################################# [100%]
[root@jia linshi]# ls /etc/yum.repos.d/
CentOS7-Base-163.repo mysql-community.repo
CentOS7-Base-163.repo.bak mysql-community-source.repo
[root@jia linshi]# yum install mysql-server
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
mysql-connectors-community | 2.5 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql56-community | 2.5 kB 00:00
(1/3): mysql-connectors-community/x86_64/primary_db | 20 kB 00:00
(2/3): mysql-tools-community/x86_64/primary_db | 41 kB 00:00
(3/3): mysql56-community/x86_64/primary_db | 191 kB 00:01
正在解決依賴關系
--> 正在檢查事務
---> 軟件包 mysql-community-server.x86_64.0.5.6.40-2.el7 將被 安裝
--> 正在處理依賴關系 mysql-community-common(x86-64) = 5.6.40-2.el7,它被軟件包 m ysql-community-server-5.6.40-2.el7.x86_64 需要
--> 正在處理依賴關系 mysql-community-client(x86-64) >= 5.6.10,它被軟件包 mysql- community-server-5.6.40-2.el7.x86_64 需要
--> 正在處理依賴關系 perl(DBI),它被軟件包 mysql-community-server-5.6.40-2.el7.x 86_64 需要
--> 正在檢查事務
---> 軟件包 mysql-community-client.x86_64.0.5.6.40-2.el7 將被 安裝
--> 正在處理依賴關系 mysql-community-libs(x86-64) >= 5.6.10,它被軟件包 mysql-co mmunity-client-5.6.40-2.el7.x86_64 需要
---> 軟件包 mysql-community-common.x86_64.0.5.6.40-2.el7 將被 安裝
---> 軟件包 perl-DBI.x86_64.0.1.627-4.el7 將被 安裝
--> 正在處理依賴關系 perl(RPC::PlServer) >= 0.2001,它被軟件包 perl-DBI-1.627-4. el7.x86_64 需要
--> 正在處理依賴關系 perl(RPC::PlClient) >= 0.2000,它被軟件包 perl-DBI-1.627-4. el7.x86_64 需要
--> 正在檢查事務
---> 軟件包 mariadb-libs.x86_64.1.5.5.56-2.el7 將被 取代
---> 軟件包 mysql-community-libs.x86_64.0.5.6.40-2.el7 將被 舍棄
---> 軟件包 perl-PlRPC.noarch.0.0.2020-14.el7 將被 安裝
--> 正在處理依賴關系 perl(Net::Daemon) >= 0.13,它被軟件包 perl-PlRPC-0.2020-14. el7.noarch 需要
--> 正在處理依賴關系 perl(Net::Daemon::Test),它被軟件包 perl-PlRPC-0.2020-14.el 7.noarch 需要
--> 正在處理依賴關系 perl(Net::Daemon::Log),它被軟件包 perl-PlRPC-0.2020-14.el7 .noarch 需要
--> 正在檢查事務
---> 軟件包 perl-Net-Daemon.noarch.0.0.48-5.el7 將被 安裝
--> 解決依賴關系完成
依賴關系解決
================================================================================
Package 架構 版本 源 大小
================================================================================
正在安裝:
mysql-community-libs x86_64 5.6.40-2.el7 mysql56-community 2.0 M
替換 mariadb-libs.x86_64 1:5.5.56-2.el7
mysql-community-server x86_64 5.6.40-2.el7 mysql56-community 59 M
為依賴而安裝:
mysql-community-client x86_64 5.6.40-2.el7 mysql56-community 19 M
mysql-community-common x86_64 5.6.40-2.el7 mysql56-community 257 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
事務概要
================================================================================
安裝 2 軟件包 (+5 依賴軟件包)
總下載量:82 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common- 5.6.40-2.el7.x86_64.rpm: 頭V3 DSA/SHA1 Signature, 密鑰 ID 5072e1f5: NOKEY
mysql-community-common-5.6.40-2.el7.x86_64.rpm 的公鑰尚未安裝
(1/7): mysql-community-common-5.6.40-2.el7.x86_64.rpm | 257 kB 00:01
(2/7): mysql-community-libs-5.6.40-2.el7.x86_64.rpm | 2.0 MB 00:00
警告:/var/cache/yum/x86_64/7/base/packages/perl-Net-Daemon-0.48-5.el7.noarch.rp m: 頭V3 RSA/SHA256 Signature, 密鑰 ID f4a80eb5: NOKEY
perl-Net-Daemon-0.48-5.el7.noarch.rpm 的公鑰尚未安裝
(3/7): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00
(4/7): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00
(5/7): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00
(6/7): mysql-community-client-5.6.40-2.el7.x86_64.rpm | 19 MB 00:08
(7/7): mysql-community-server-5.6.40-2.el7.x86_64.rpm | 59 MB 00:19
--------------------------------------------------------------------------------
總計 3.7 MB/s | 82 MB 00:21
從 http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 檢索密鑰
導入 GPG key 0xF4A80EB5:
用戶ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <[email protected] >"
指紋 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
來自 : http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
是否繼續?[y/N]:y
從 file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 檢索密鑰
導入 GPG key 0x5072E1F5:
用戶ID : "MySQL Release Engineering <[email protected]>"
指紋 : a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
軟件包 : mysql-community-release-el7-5.noarch (installed)
來自 : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
是否繼續?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 數據庫已被非 yum 程序修改。
正在安裝 : mysql-community-common-5.6.40-2.el7.x86_64 1/8
正在安裝 : mysql-community-libs-5.6.40-2.el7.x86_64 2/8
正在安裝 : mysql-community-client-5.6.40-2.el7.x86_64 3/8
正在安裝 : perl-Net-Daemon-0.48-5.el7.noarch 4/8
正在安裝 : perl-PlRPC-0.2020-14.el7.noarch 5/8
正在安裝 : perl-DBI-1.627-4.el7.x86_64 6/8
正在安裝 : mysql-community-server-5.6.40-2.el7.x86_64 7/8
正在刪除 : 1:mariadb-libs-5.5.56-2.el7.x86_64 8/8
驗證中 : perl-Net-Daemon-0.48-5.el7.noarch 1/8
驗證中 : mysql-community-server-5.6.40-2.el7.x86_64 2/8
驗證中 : perl-PlRPC-0.2020-14.el7.noarch 3/8
驗證中 : mysql-community-client-5.6.40-2.el7.x86_64 4/8
驗證中 : mysql-community-libs-5.6.40-2.el7.x86_64 5/8
驗證中 : mysql-community-common-5.6.40-2.el7.x86_64 6/8
驗證中 : perl-DBI-1.627-4.el7.x86_64 7/8
驗證中 : 1:mariadb-libs-5.5.56-2.el7.x86_64 8/8
已安裝:
mysql-community-libs.x86_64 0:5.6.40-2.el7 mysql-community-server.x86_64 0:5.6.40-2.el7
作為依賴被安裝:
mysql-community-client.x86_64 0:5.6.40-2.el7
mysql-community-common.x86_64 0:5.6.40-2.el7
perl-DBI.x86_64 0:1.627-4.el7
perl-Net-Daemon.noarch 0:0.48-5.el7
perl-PlRPC.noarch 0:0.2020-14.el7
替代:
mariadb-libs.x86_64 1:5.5.56-2.el7
完畢!
[root@jia linshi]# systemctl start mysqld
[root@jia linshi]# systemctl status mysqld
[root@jia linshi]# systemctl enable mysqld
CentOS Linux release 7.5.1804安裝mysql