centos6.7 安装mysql时出错

centos6.7 安装mysql时出错
Error: Package: 2:postfix-2.6.6-6.el6_7.1.x86_64 (@updates)
       Requires: libmysqlclient.so.16()(64bit)
       Removing: mysql-libs-5.1.73-5.el6_6.x86_64 (@base)
           libmysqlclient.so.16()(64bit)
       Obsoleted By: mysql-community-libs-5.6.29-2.el7.x86_64 (mysql56-community)
           Not found Error: Package: nagios-plugins-mysql-2.0.3-3.el6.x86_64 (@epel)
       Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
       Removing: mysql-libs-5.1.73-5.el6_6.x86_64 (@base)
           libmysqlclient.so.16(libmysqlclient_16)(64bit)
       Obsoleted By: mysql-community-libs-5.6.29-2.el7.x86_64 (mysql56-community)
           Not found Error: Package: 2:postfix-2.6.6-6.el6_7.1.x86_64 (@updates)
       Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
       Removing: mysql-libs-5.1.73-5.el6_6.x86_64 (@base)
           libmysqlclient.so.16(libmysqlclient_16)(64bit)
       Obsoleted By: mysql-community-libs-5.6.29-2.el7.x86_64 (mysql56-community)
           Not found Error: Package: mysql-community-libs-5.6.29-2.el7.x86_64 (mysql56-community)
       Requires: libc.so.6(GLIBC_2.17)(64bit)Error: Package: nagios-plugins-mysql-2.0.3-3.el6.x86_64 (@epel)
       Requires: libmysqlclient.so.16()(64bit)
       Removing: mysql-libs-5.1.73-5.el6_6.x86_64 (@base)
           libmysqlclient.so.16()(64bit)
       Obsoleted By: mysql-community-libs-5.6.29-2.el7.x86_64 (mysql56-community)
           Not found  You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest

面对这个

sudo rpm -Uvhhttp://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

答案1

我建议使用IUS 存储库。因为它是专门为 Red Hat Enterprise Linux (RHEL) 和 CentOS 设计的。

# wget https://dl.iuscommunity.org/pub/ius/IUS-COMMUNITY-GPG-KEY -O /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY
# rpm --import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY
# yum -y install https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-14.ius.centos6.noarch.rpm

但不幸的是,没有简单的方法可以做到这一点。这有点棘手

# wget https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/mysql56u-libs-5.6.29-1.ius.centos6.x86_64.rpm  
# rpm -ivh --nodeps --force mysql56u-libs-5.6.29-1.ius.centos6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:mysql56u-libs          ########################################### [100%]

# yum erase mysql-libs   

之后,你可以像平常一样通过 yum 安装 mysql 服务器

# yum install mysql56u-server.x86_64 mysql56u.x86_64 mysql56u-common.x86_64 mysqlclient16.x86_64

mysqlclient16 软件包只是为了向后兼容而替换 mysql-lib

# yum info mysqlclient16
Name        : mysqlclient16
Arch        : x86_64
Version     : 5.1.61
Release     : 4.ius.centos6
Size        : 4.1 M
Repo        : ius
Summary     : Backlevel MySQL shared libraries.
URL         : http://www.mysql.com
License     : GPL
Description : This package contains backlevel versions of the MySQL client libraries
            : for use with applications linked against them.  These shared libraries
            : were created using MySQL 5.1.61.

如果你需要 mysql 5.5/5.7,只需将 mysql56u 替换为 mysql55/mysql57u

答案2

http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/#repo-qg-yum-fresh-install

通过点击此链接并通过运行删除先前的链接

sudo rpm -e http://repo.mysql.com/mysql-community-release-el7-5.noarch 

我解决了我的问题。

解释:我尝试从包含为 RHEL 6 兼容操作系统上的 Redhat Enterprise Linux 7 构建的 RPM 的 MySQL 存储库进行安装。这导致各种依赖项不匹配。切换到正确的 MySQL 存储库可以解决问题。

相关内容