参考文档:http://www.jjhr.net/2015/01/install-rhel-epel-repo-on-centos-5-x-or-6-x/

原由:使用yum安装完成mysql、php后,mysql的版本是5.1,最新版本的PhpMyAdmin4.5不支持,需要升级mysql到5.5.

环境:CentOS 6.7 ,Mysql  5.1,PHP5.3.,Apache 2.2.15 全部采用Yum安装。其中PHP使用yum升级到了5.5.16.

1.配置新的yum源。

[root@centosphpyum ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

报错:

Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm warning: /var/tmp/rpm-tmp.AmzSjH: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
error: Failed dependencies:
        epel-release >= 6 is needed by remi-release-6.6-2.el6.remi.noarch

2.解决错误:

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -ivh epel-release-6-8.noarch.rpm
rpm -ivh remi-release-6.rpm

配置源配置文件:

ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo

编辑[remi]下的enabled选项从0设为1

[remi]
 name=Les RPM de remi pour Enterprise Linux 6 - $basearch
 #baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
 mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
 enabled=1
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi


3.更新库更新完成后,开始升级mysql。

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

4.查看更新库中可用的版本:

yum --enablerepo=remi,remi-test list mysql mysql-server


5.升级mysql。


yum --enablerepo=remi install mysql mysql-server


6.测试升级成功。



日志如下:


root@centosphpyum ~]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm --2016-01-06 15:05:34--  http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 正在解析主机 dl.fedoraproject.org... 209.132.181.26, 209.132.181.27, 209.132.181.23, ...
正在连接 dl.fedoraproject.org|209.132.181.26|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:14540 (14K) [application/x-rpm]
正在保存至: “epel-release-6-8.noarch.rpm”

100%[===================================================================================================================================================================================================>] 14,540      62.6K/s   in 0.2s   

2016-01-06 15:05:35 (62.6 KB/s) - 已保存 “epel-release-6-8.noarch.rpm” [14540/14540])

[root@centosphpyum ~]# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm --2016-01-06 15:06:39--  http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 正在解析主机 rpms.famillecollet.com... 195.154.241.117, 2001:bc8:33a1:100::1
正在连接 rpms.famillecollet.com|195.154.241.117|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:7615 (7.4K) [application/x-rpm]
正在保存至: “remi-release-6.rpm”

100%[===================================================================================================================================================================================================>] 7,615       --.-K/s   in 0s     

2016-01-06 15:06:40 (18.0 MB/s) - 已保存 “remi-release-6.rpm” [7615/7615])

[root@centosphpyum ~]# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@centosphpyum ~]# rpm -ivh remi-release-6.rpm
warning: remi-release-6.rpm: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Preparing...                ########################################### [100%]
   1:remi-release           ########################################### [100%]
[root@centosphpyum ~]# ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/remi.repo
[root@centosphpyum ~]# vi /etc/yum.repos.d/remi.repo
# Repository: http://rpms.remirepo.net/ # Blog:       http://blog.remirepo.net/ # Forum:      http://forum.remirepo.net/

[remi]
 name=Remi's RPM repository for Enterprise Linux 6 - $basearch
 #baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
 mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi[remi-php55]
 name=Remi's PHP 5.5 RPM repository for Enterprise Linux 6 - $basearch
 #baseurl=http://rpms.remirepo.net/enterprise/6/php55/$basearch/
 mirrorlist=http://rpms.remirepo.net/enterprise/6/php55/mirror
 # NOTICE: common dependencies are in "remi-safe"
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi[remi-php56]
 name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
 #baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
 mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
 # NOTICE: common dependencies are in "remi-safe"
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi[remi-test]
 name=Remi's test RPM repository for Enterprise Linux 6 - $basearch
 #baseurl=http://rpms.remirepo.net/enterprise/6/test/$basearch/
 mirrorlist=http://rpms.remirepo.net/enterprise/6/test/mirror
 # WARNING: If you enable this repository, you must also enable "remi"
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi[remi-debuginfo]
 name=Remi's RPM repository for Enterprise Linux 6 - $basearch - debuginfo
 baseurl=http://rpms.remirepo.net/enterprise/6/debug-remi/$basearch/
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi[remi-php55-debuginfo]
 name=Remi's PHP 5.5 RPM repository for Enterprise Linux 6 - $basearch - debuginfo
 baseurl=http://rpms.remirepo.net/enterprise/6/debug-php55/$basearch/
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi[remi-php56-debuginfo]
 name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch - debuginfo
 baseurl=http://rpms.remirepo.net/enterprise/6/debug-php56/$basearch/
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi[remi-test-debuginfo]
 name=Remi's test RPM repository for Enterprise Linux 6 - $basearch - debuginfo
 baseurl=http://rpms.remirepo.net/enterprise/6/debug-test/$basearch/
 enabled=0
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi~
 # Repository: http://rpms.remirepo.net/ # Blog:       http://blog.remirepo.net/ # Forum:      http://forum.remirepo.net/[remi]
 name=Remi's RPM repository for Enterprise Linux 6 - $basearch
 #baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
 mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
 "/etc/yum.repos.d/remi.repo" 67L, 2340C written
 [root@centosphpyum ~]# 
 [root@centosphpyum ~]# 
 [root@centosphpyum ~]# rpm -Uvh  http://rpms.famillecollet.com/enterprise/remi-release-6.rpm Retrieving  http://rpms.famillecollet.com/enterprise/remi-release-6.rpm warning: /var/tmp/rpm-tmp.1MXUfb: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
 Preparing...                ########################################### [100%]
         package remi-release-6.6-2.el6.remi.noarch is already installed
 [root@centosphpyum ~]# yum --enablerepo=remi,remi-test list mysql mysql-server
 已加载插件:fastestmirror, refresh-packagekit, security
 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 contrib 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
 Repository contrib is listed more than once in the configuration
 Loading mirror speeds from cached hostfile
 epel/metalink                                                                                           | 5.5 kB     00:00     
  * epel: mirrors.hustunique.com
  * remi: remi.kazukioishi.net
  * remi-safe: remi.kazukioishi.net
  * remi-test: remi.kazukioishi.net
  * webtatic: sp.repo.webtatic.com
 epel                                                                                                    | 4.3 kB     00:00     
 epel/primary_db                                                                                         | 5.7 MB     00:01     
 remi                                                                                                    | 2.9 kB     00:00     
 remi/primary_db                                                                                         | 1.3 MB     00:01     
 remi-safe                                                                                               | 2.9 kB     00:00     
 remi-safe/primary_db                                                                                    | 231 kB     00:00     
 remi-test                                                                                               | 2.9 kB     00:00     
 remi-test/primary_db                                                                                    | 246 kB     00:00     
 已安装的软件包
 mysql.x86_64                                                  5.1.73-5.el6_6                                              @base
 mysql-server.x86_64                                           5.1.73-5.el6_6                                              @base
 可安装的软件包
 mysql.x86_64                                                  5.5.47-1.el6.remi                                           remi 
 mysql-server.x86_64                                           5.5.47-1.el6.remi                                           remi 
 [root@centosphpyum ~]# yum --enablerepo=remi install mysql mysql-server
 已加载插件:fastestmirror, refresh-packagekit, security
 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 contrib 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
 Repository contrib is listed more than once in the configuration
 设置安装进程
 Loading mirror speeds from cached hostfile
  * epel: mirrors.hustunique.com
  * remi: mirror.innosol.asia
  * remi-safe: mirror.innosol.asia
  * webtatic: sp.repo.webtatic.com


解决依赖关系
--> 执行事务检查
---> Package mysql.x86_64 0:5.1.73-5.el6_6 will be 升级
--> 处理依赖关系 mysql = 5.1.73-5.el6_6,它被软件包 mysql-devel-5.1.73-5.el6_6.x86_64 需要
---> Package mysql.x86_64 0:5.5.47-1.el6.remi will be an update
--> 处理依赖关系 real-mysql-libs(x86-64) = 5.5.47-1.el6.remi,它被软件包 mysql-5.5.47-1.el6.remi.x86_64 需要
---> Package mysql-server.x86_64 0:5.1.73-5.el6_6 will be 升级
---> Package mysql-server.x86_64 0:5.5.47-1.el6.remi will be an update
--> 执行事务检查
---> Package mysql-devel.x86_64 0:5.1.73-5.el6_6 will be 升级
---> Package mysql-devel.x86_64 0:5.5.47-1.el6.remi will be an update
---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be 升级
--> 处理依赖关系 libmysqlclient.so.16()(64bit),它被软件包 php56w-mysql-5.6.16-1.w6.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16()(64bit),它被软件包 1:mod_auth_mysql-3.0.0-11.el6_0.1.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16()(64bit),它被软件包 2:postfix-2.6.6-6.el6_7.1.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16()(64bit),它被软件包 perl-DBD-MySQL-4.013-3.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16()(64bit),它被软件包 libdbi-dbd-mysql-0.8.3-5.1.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16(libmysqlclient_16)(64bit),它被软件包 php56w-mysql-5.6.16-1.w6.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16(libmysqlclient_16)(64bit),它被软件包 1:mod_auth_mysql-3.0.0-11.el6_0.1.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16(libmysqlclient_16)(64bit),它被软件包 2:postfix-2.6.6-6.el6_7.1.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16(libmysqlclient_16)(64bit),它被软件包 perl-DBD-MySQL-4.013-3.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16(libmysqlclient_16)(64bit),它被软件包 libdbi-dbd-mysql-0.8.3-5.1.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16()(64bit),它被软件包 mysql-connector-odbc-5.1.5r1144-7.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16()(64bit),它被软件包 php56w-mysql-5.6.16-1.w6.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16(libmysqlclient_16)(64bit),它被软件包 mysql-connector-odbc-5.1.5r1144-7.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16(libmysqlclient_16)(64bit),它被软件包 php56w-mysql-5.6.16-1.w6.x86_64 需要
---> Package mysql-libs.x86_64 0:5.5.47-1.el6.remi will be an update
--> 执行事务检查
---> Package compat-mysql51.x86_64 0:5.1.54-1.el6.remi will be 安装
--> 完成依赖关系计算

依赖关系解决

===============================================================================================================================
 软件包                           架构                     版本                                   仓库                    大小
===============================================================================================================================
正在升级:
 mysql                            x86_64                   5.5.47-1.el6.remi                      remi                   5.8 M
 mysql-server                     x86_64                   5.5.47-1.el6.remi                      remi                    10 M
为依赖而安装:
 compat-mysql51                   x86_64                   5.1.54-1.el6.remi                      remi                   1.4 M
为依赖而更新:
 mysql-devel                      x86_64                   5.5.47-1.el6.remi                      remi                   164 k
 mysql-libs                       x86_64                   5.5.47-1.el6.remi                      remi                   778 k

事务概要
===============================================================================================================================
Install       1 Package(s)
Upgrade       4 Package(s)

总下载量:18 M
确定吗?[y/N]:y
下载软件包:

(1/5): compat-mysql51-5.1.54-1.el6.remi.x86_64.rpm                                                      | 1.4 MB     00:07     
 (2/5): mysql-5.5.47-1.el6.remi.x86_64.rpm                                                               | 5.8 MB     01:31     
 (3/5): mysql-devel-5.5.47-1.el6.remi.x86_64.rpm                                                         | 164 kB     00:03     
 (4/5): mysql-libs-5.5.47-1.el6.remi.x86_64.rpm                                                          | 778 kB     00:17     
 (5/5): mysql-server-5.5.47-1.el6.remi.x86_64.rpm                                                        |  10 MB     02:20


-------------------------------------------------------------------------------------------------------------------------------
总计                                                                                            71 kB/s |  18 MB     04:20    
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Importing GPG key 0x00F97F56:
 Userid : Remi Collet <RPMS@FamilleCollet.com>
 Package: remi-release-6.6-2.el6.remi.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
确定吗?[y/N]:y
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
Warning: RPMDB altered outside of yum.

WARNING : This MySQL RPM is not an official Fedora / Red Hat build and it
overrides the official one. Don't file bugs on Fedora Project nor Red Hat.
Use dedicated forum at http://forum.remirepo.net/

  正在升级   : mysql-libs-5.5.47-1.el6.remi.x86_64                                                                         1/9
  正在升级   : mysql-5.5.47-1.el6.remi.x86_64                                                                              2/9
  正在升级   : mysql-devel-5.5.47-1.el6.remi.x86_64                                                                        3/9
  正在升级   : mysql-server-5.5.47-1.el6.remi.x86_64                                                                       4/9
  正在安装   : compat-mysql51-5.1.54-1.el6.remi.x86_64                                                                     5/9
  清理       : mysql-devel-5.1.73-5.el6_6.x86_64                                                                           6/9
  清理       : mysql-server-5.1.73-5.el6_6.x86_64                                                                          7/9
  清理       : mysql-5.1.73-5.el6_6.x86_64                                                                                 8/9
  清理       : mysql-libs-5.1.73-5.el6_6.x86_64                                                                            9/9
  Verifying  : mysql-devel-5.5.47-1.el6.remi.x86_64                                                                        1/9
  Verifying  : mysql-5.5.47-1.el6.remi.x86_64                                                                              2/9
  Verifying  : compat-mysql51-5.1.54-1.el6.remi.x86_64                                                                     3/9
  Verifying  : mysql-libs-5.5.47-1.el6.remi.x86_64                                                                         4/9
  Verifying  : mysql-server-5.5.47-1.el6.remi.x86_64                                                                       5/9
  Verifying  : mysql-libs-5.1.73-5.el6_6.x86_64                                                                            6/9
  Verifying  : mysql-5.1.73-5.el6_6.x86_64                                                                                 7/9
  Verifying  : mysql-server-5.1.73-5.el6_6.x86_64                                                                          8/9
  Verifying  : mysql-devel-5.1.73-5.el6_6.x86_64                                                                           9/9

作为依赖被安装:
  compat-mysql51.x86_64 0:5.1.54-1.el6.remi                                                                                   

更新完毕:
  mysql.x86_64 0:5.5.47-1.el6.remi                           mysql-server.x86_64 0:5.5.47-1.el6.remi                         

作为依赖被升级:
  mysql-devel.x86_64 0:5.5.47-1.el6.remi                         mysql-libs.x86_64 0:5.5.47-1.el6.remi                       

完毕!