较新的 libmysqlclient.so 与 php-mysql 安装产生冲突

较新的 libmysqlclient.so 与 php-mysql 安装产生冲突

我在 CentOS 6.4 上有一个运行良好的 MySQL 5.6 服务器,
我正在尝试让 PHP 也能运行,并创建与 MySQL 的连接。
据我所知,我需要以下组件:php 和 php-mysql

yum install php

运行没有问题。

yum install php-mysql

出现以下错误:

Transaction Check Error:
  file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1256.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1257.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/cp850.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/cp852.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/cp866.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/dec8.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/geostd8.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/greek.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/hebrew.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/hp8.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/koi8r.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/koi8u.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/latin1.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/latin2.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/latin5.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/latin7.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/macce.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/macroman.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/charsets/swe7.xml from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64
  file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.69-1.el6_4.x86_64 conflicts with file from package MySQL-server-5.6.13-1.el6.x86_64

Error Summary
-------------

据我检查,如果不解决冲突,就无法让 yum 继续安装。因此,我尝试使用 rpm php-mysql-5.3.3-22.el6.x86_64.rpm 以及依赖项:
php-pdo-5.3.3-22.el6.x86_64.rpm
php-common-5.3.3-22.el6.x86_64.rpm

php-pdo 和 php-common 安装但 php-mysql 出现此错误:

error: Failed dependencies:
    libmysqlclient.so.16()(64bit) is needed by php-mysql-5.3.3-22.el6.x86_64
    libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by php-mysql-5.3.3-22.el6.x86_64
    php-common(x86-64) = 5.3.3-22.el6 is needed by php-mysql-5.3.3-22.el6.x86_64
    php-pdo(x86-64) is needed by php-mysql-5.3.3-22.el6.x86_64

这是 find / -name libmysqlclient 的输出

/usr/lib64/libmysqlclient_r.so.18.1.0
/usr/lib64/mysql/libmysqlclient.a
/usr/lib64/mysql/libmysqlclient_r.a
/usr/lib64/libmysqlclient.so.18.1.0
/usr/lib64/libmysqlclient_r.so
/usr/lib64/libmysqlclient.so
/usr/lib64/libmysqlclient.so.18
/usr/lib64/libmysqlclient_r.so.18

我读到 libmysqlclient.so.16 是以下 rpm 的一部分:

MySQL-shared-compat-5.1.47-1.rhel5.x86_64.rpm,
但是由于与我作为 MySQL 安装的一部分安装的较新的 shared-compat 冲突,因此无法安装。

答案1

MySQL-server-5.6.13-1.el6.x86_64 由 MySQL 提供,并且会与 CentOS 维护的软件包冲突。

为了解决这个问题,最好的办法是(安全地)恢复到 CentOS 提供的 mysql-server 包,并在恢复运行后安装 PHP 模块。

否则,您可能需要从源代码编译 PHP 以满足 php-mysql 包的所有要求。

答案2

听起来像这个错误:#63085Oracle 的较新版本的 MySQL 已经解决了此问题:

Fixed in 5.5.27.

页面上写着

[3月27日 11:32] Bryan Hollis

是的,

这很容易解决。幸运的是,它是 CentOS 或 el6,而不是 Fedora。

步骤 1:在 ssh 终端中以 root 身份执行 # yum remove mysql-libs

  • 您正在摆脱不兼容的旧 Sql 库。

第 2 步:# yum clean dbcache(清理)第 3 步:从头开始安装新的 Mysql 服务器和依赖项。

删除旧软件包后,您将失去许多依赖项,但您可以更新其他项目,例如 phpMyAdmin……所有这些都取决于发行版。在我完整安装了具有相同 Sql 和 CPanels 的 CentOS 6.4 后,这种方法对我有用,更改顺利进行。祝你好运 - BPH

您可能希望首先在测试环境中执行此操作,以验证您不会意外删除一些额外的依赖项或其他有价值的数据等。

答案3

尝试:

yum --enablerepo=remi install php-mysqlnd.x86_64

我在 CentOS 6.3 上安装了它并且它运行正常。

相关内容