Linux – newer libthesqlclient.so creates a conflicts with a php-thesql install

linuxMySQLPHPrpmyum

I have a working MySQL 5.6 server on a CentOS 6.4
I'm trying tp get PHP working as well, and to create a connection to the MySQL.
As I understand I need the following components : php and php-mysql

yum install php

runs without problems.

yum install php-mysql

gives the following errors:

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
-------------

from what I've checked there is no possibility to let yum go on with the install without resolving the conflicts.
So I've tried with rpm's php-mysql-5.3.3-22.el6.x86_64.rpm and also the dependencies:
php-pdo-5.3.3-22.el6.x86_64.rpm
php-common-5.3.3-22.el6.x86_64.rpm

the php-pdo and php-common install but the php-mysql gives this error :

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

This is the output of 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

I read that libmysqlclient.so.16 is part of the following rpm :

MySQL-shared-compat-5.1.47-1.rhel5.x86_64.rpm
but it won't install becuase of conflicts with the newer shared-compat that I've installed as part of the MySQL installation.

Best Answer

MySQL-server-5.6.13-1.el6.x86_64 is provided by MySQL and will conflict with the packages maintained by CentOS.

In order to resolve this, your best bet is to (safely) revert to the mysql-server package provided by CentOS and install the PHP modules once you're back up and running.

Otherwise, you're probably looking at having to compile PHP from source to satisfy all the requirements of the php-mysql package.

Related Topic