// 查询
[root@wode006 yum.repos.d]# yum install mysql
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
软件包 1:mariadb-5.5.41-2.el7_0.x86_64 已安装并且是最新版本
无须任何处理
[root@wode006 yum.repos.d]#
// 下载MySQL repo
[root@wode006 tools]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
--2015-07-04 00:43:49-- http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
正在解析主机 repo.mysql.com (repo.mysql.com)... 23.13.186.195
正在连接 repo.mysql.com (repo.mysql.com)|23.13.186.195|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:6140 (6.0K) [application/x-redhat-package-manager]
正在保存至: “mysql-community-release-el7-5.noarch.rpm”
100%[======================================>] 6,140 --.-K/s 用时 0.004s
2015-07-04 00:43:49 (1.53 MB/s) - 已保存 “mysql-community-release-el7-5.noarch.rpm” [6140/6140])
// 安装源
[root@wode006 tools]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-release-el7-5 ################################# [100%]
[root@wode006 tools]#
// 更新repo
[root@wode006 tools]# yum makecache
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
mysql-connectors-community | 2.5 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql56-community | 2.5 kB 00:00
updates | 3.4 kB 00:00
(1/6): mysql-connectors-community/x86_64/filelists_db | 4.8 kB 00:00
(2/6): mysql-tools-community/x86_64/filelists_db | 47 kB 00:00
(3/6): mysql56-community/x86_64/other_db | 26 kB 00:00
(4/6): mysql-connectors-community/x86_64/other_db | 2.7 kB 00:00
(5/6): mysql-tools-community/x86_64/other_db | 3.2 kB 00:00
(6/6): mysql56-community/x86_64/filelists_db | 293 kB 00:00
Loading mirror speeds from cached hostfile
元数据缓存已建立
[root@wode006 tools]#
// 安装mysql-server
[root@wode006 tools]# yum install mysql-server
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 mariadb-server.x86_64.1.5.5.41-2.el7_0 将被 取代
--> 正在处理依赖关系 mariadb-server,它被软件包 akonadi-mysql-1.9.2-4.el7.x86_64 需要
---> 软件包 mysql-community-server.x86_64.0.5.6.25-2.el7 将被 舍弃
--> 正在处理依赖关系 mysql-community-common(x86-64) = 5.6.25-2.el7,它被软件包 mysql-community-server-5.6.25-2.el7.x86_64 需要
--> 正在处理依赖关系 mysql-community-client(x86-64) = 5.6.25-2.el7,它被软件包 mysql-community-server-5.6.25-2.el7.x86_64 需要
--> 正在检查事务
---> 软件包 mariadb.x86_64.1.5.5.41-2.el7_0 将被 取代
---> 软件包 mariadb-server.x86_64.1.5.5.41-2.el7_0 将被 取代
--> 正在处理依赖关系 mariadb-server,它被软件包 akonadi-mysql-1.9.2-4.el7.x86_64 需要
---> 软件包 mysql-community-client.x86_64.0.5.6.25-2.el7 将被 舍弃
--> 正在处理依赖关系 mysql-community-libs(x86-64) = 5.6.25-2.el7,它被软件包 mysql-community-client-5.6.25-2.el7.x86_64 需要
---> 软件包 mysql-community-common.x86_64.0.5.6.25-2.el7 将被 安装
--> 正在检查事务
---> 软件包 mariadb-libs.x86_64.1.5.5.41-2.el7_0 将被 取代
---> 软件包 mariadb-server.x86_64.1.5.5.41-2.el7_0 将被 取代
--> 正在处理依赖关系 mariadb-server,它被软件包 akonadi-mysql-1.9.2-4.el7.x86_64 需要
---> 软件包 mysql-community-libs.x86_64.0.5.6.25-2.el7 将被 舍弃
--> 解决依赖关系完成
错误:软件包:akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda)
需要:mariadb-server
正在删除: 1:mariadb-server-5.5.41-2.el7_0.x86_64 (@anaconda)
mariadb-server = 1:5.5.41-2.el7_0
取代,由: mysql-community-server-5.6.25-2.el7.x86_64 (mysql56-community)
未找到
您可以尝试添加 --skip-broken 选项来解决该问题
您可以尝试执行:rpm -Va --nofiles --nodigest
[root@wode006 tools]#
// 删除 mariadb-server
[root@wode006 tools]# yum remove mariadb-server
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
正在解决依赖关系
--> 正在检查事务
---> 软件包 mariadb-server.x86_64.1.5.5.41-2.el7_0 将被 删除
--> 正在处理依赖关系 mariadb-server,它被软件包 akonadi-mysql-1.9.2-4.el7.x86_64 需要
--> 正在检查事务
---> 软件包 akonadi-mysql.x86_64.0.1.9.2-4.el7 将被 删除
--> 解决依赖关系完成
依赖关系解决
================================================================================
Package 架构 版本 源 大小
================================================================================
正在删除:
mariadb-server x86_64 1:5.5.41-2.el7_0 @anaconda 56 M
为依赖而移除:
akonadi-mysql x86_64 1.9.2-4.el7 @anaconda 9.6 k
事务概要
================================================================================
移除 1 软件包 (+1 依赖软件包)
安装大小:56 M
是否继续?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
正在删除 : akonadi-mysql-1.9.2-4.el7.x86_64 1/2
正在删除 : 1:mariadb-server-5.5.41-2.el7_0.x86_64 2/2
验证中 : akonadi-mysql-1.9.2-4.el7.x86_64 1/2
验证中 : 1:mariadb-server-5.5.41-2.el7_0.x86_64 2/2
删除:
mariadb-server.x86_64 1:5.5.41-2.el7_0
作为依赖被删除:
akonadi-mysql.x86_64 0:1.9.2-4.el7
完毕!
[root@wode006 tools]#
// 再次安装 mysql-server
[root@wode006 tools]# yum install mysql-server
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 mysql-community-server.x86_64.0.5.6.25-2.el7 将被 安装
--> 正在处理依赖关系 mysql-community-common(x86-64) = 5.6.25-2.el7,它被软件包 mysql-community-server-5.6.25-2.el7.x86_64 需要
--> 正在处理依赖关系 mysql-community-client(x86-64) = 5.6.25-2.el7,它被软件包 mysql-community-server-5.6.25-2.el7.x86_64 需要
--> 正在检查事务
---> 软件包 mariadb.x86_64.1.5.5.41-2.el7_0 将被 取代
---> 软件包 mysql-community-client.x86_64.0.5.6.25-2.el7 将被 舍弃
--> 正在处理依赖关系 mysql-community-libs(x86-64) = 5.6.25-2.el7,它被软件包 mysql-community-client-5.6.25-2.el7.x86_64 需要
---> 软件包 mysql-community-common.x86_64.0.5.6.25-2.el7 将被 安装
--> 正在检查事务
---> 软件包 mariadb-libs.x86_64.1.5.5.41-2.el7_0 将被 取代
---> 软件包 mysql-community-libs.x86_64.0.5.6.25-2.el7 将被 舍弃
--> 解决依赖关系完成
依赖关系解决
================================================================================
Package 架构 版本 源 大小
================================================================================
正在安装:
mysql-community-client x86_64 5.6.25-2.el7 mysql56-community 19 M
替换 mariadb.x86_64 1:5.5.41-2.el7_0
mysql-community-libs x86_64 5.6.25-2.el7 mysql56-community 2.0 M
替换 mariadb-libs.x86_64 1:5.5.41-2.el7_0
mysql-community-server x86_64 5.6.25-2.el7 mysql56-community 58 M
为依赖而安装:
mysql-community-common x86_64 5.6.25-2.el7 mysql56-community 256 k
事务概要
================================================================================
安装 3 软件包 (+1 依赖软件包)
总下载量:79 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.25-2.el7.x86_64.rpm: V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
mysql-community-common-5.6.25-2.el7.x86_64.rpm 的公钥尚未安装
(1/4): mysql-community-common-5.6.25-2.el7.x86_64.rpm | 256 kB 00:01
(2/4): mysql-community-libs-5.6.25-2.el7.x86_64.rpm | 2.0 MB 00:11
(3/4): mysql-community-client-5.6.25-2.el7.x86_64.rpm | 19 MB 00:54
(4/4): mysql-community-ser 45% [======= ] 502 kB/s | 36 MB 01:28 ETA
// 设置开机启动
[root@wode006 tools]# systemctl enable mysqld
[root@wode006 tools]#
// 手动启动
[root@wode006 tools]# systemctl start mysqld
[root@wode006 tools]#
转载于:https://blog.51cto.com/huangchao/1670742