Percona-Server-Shared-55 >= 5.5.36 lacks libmysqlclient.so.18

Bug #1291249 reported by René Diepstraten
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Unassigned
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
High
Tomislav Plavcic
5.6
Invalid
Undecided
Unassigned

Bug Description

On several servers, we are running Percona Server 5.5 and php 5.x compiled against Percona-Server-Shared-55 .
Today we ran into an issue while upgrading Percona-Server-Shared-55 from 5.5.35-rel33.0.611.rhel6.x86_64 to 5.5.36-rel34.0.el6.x86_64 :
Apache would not start because php was linked against libmysqlclient.so.18 , which in this _minor_ upgrade is renamed to libperconaserverclient.so.18 , thus breaking php.
If such a change would occur in a minor upgrade, a symlink should be provided to maintain backwards compatibility:
/usr/lib64/libmysqlclient.so.18.0.0 -> /usr/lib64/libperconaserverclient.so.18.0.0

Tags: pkg

Related branches

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Rene,

If you built php-mysql against Percona-Server-Shared-55, then you will need to rebuild against Percona-Server-Shared-55 again (with Percona-Server-devel-55 installed for mysql_config).

Otherwise, the php you are using, which repo is it from? The php from CentOS6 repo is still linked against libmysqlclient.so.16. http://pkgs.org/centos-6/centos-i386/php-mysql-5.3.3-26.el6.i686.rpm.html, which is provided by mysql-libs and Percona-Server-shared-51 package.

If you are using php from other repo (linked against libmysqlclient.so.18) then you will need to use mysql-libs from that repo.

The reason such a symlink doesn't exist is that we didn't want conflict with upstream libmysqlclient.so.{16..18.1} libraries. (and thus be compatible with them).

mysql-libs-5.5.36 is available otherwise from other repos as well - http://pkgs.org/search/?keyword=mysql-libs (atomic for instance has it)

Revision history for this message
René Diepstraten (rene-renediepstraten) wrote :

We're using quite a number of DirectAdmin servers, which compile php5 using custombuild.
Undoubtedly, if compiling again, they will be compiled against libmysqlclient.so.16 from Percona-Server-Shared-compat.
But, as it is, simply performing the minor upgrade will cause libmysqlclient.so.18 to be removed and will break php until we recompile it.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

> Undoubtedly, if compiling again, they will be compiled against libmysqlclient.so.16 from Percona-Server-Shared-compat.

If you are building against Percona-Server-Shared-55 / Percona-Server-devel-55, it will be built against libperconaserverclient.so.18 (which is same as libmysqlclient.so.18 sans the name (to avoid conflicts)).

This is what mysql_config from -devel-55 would give:

mysql_config --libs
-L/usr/lib64 -lperconaserverclient -lpthread -lm -lrt -lssl -lcrypto -ldl

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

One more thing, here, Percona-Server-shared-55 still 'Provides' mysql-libs, otherwise the upgrade would have been prevented. That part is a bug.

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

This is easy to confirm comparing what RPM "provides" vs list of files it contains:

openxs@ao756:~$ rpm -qp --provides Percona-Server-shared-55-5.5.36-rel34.0.el6.x86_64.rpm
libperconaserverclient.so.18()(64bit)
libperconaserverclient.so.18(libperconaserverclient_16)(64bit)
libperconaserverclient.so.18(libperconaserverclient_18)(64bit)
mysql-libs
mysql-shared
Percona-Server-shared-55 = 5.5.36-rel34.0.el6
Percona-Server-shared-55(x86-64) = 5.5.36-rel34.0.el6
openxs@ao756:~$ rpm -qpl Percona-Server-shared-55-5.5.36-rel34.0.el6.x86_64.rpm /usr/lib64/libperconaserverclient.so
/usr/lib64/libperconaserverclient.so.18
/usr/lib64/libperconaserverclient.so.18.0.0
/usr/lib64/libperconaserverclient_r.so
/usr/lib64/libperconaserverclient_r.so.18
/usr/lib64/libperconaserverclient_r.so.18.0.0

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

5.6.16 seems correct with regards to what it "provides":

openxs@ao756:~$ rpm -qp --provides Percona-Server-shared-56-5.6.16-rel64.0.el6.x86_64.rpm
libperconaserverclient.so.18()(64bit)
libperconaserverclient.so.18(libperconaserverclient_18)(64bit)
Percona-Server-shared-56 = 5.6.16-rel64.0.el6
Percona-Server-shared-56(x86-64) = 5.6.16-rel64.0.el6
openxs@ao756:~$ rpm -qpl Percona-Server-shared-56-5.6.16-rel64.0.el6.x86_64.rpm /usr/lib64/libperconaserverclient.so.18
/usr/lib64/libperconaserverclient.so.18.1.0
/usr/lib64/libperconaserverclient_r.so.18
/usr/lib64/libperconaserverclient_r.so.18.1.0

tags: added: pkg
Revision history for this message
René Diepstraten (rene-renediepstraten) wrote :

php config still fails because it looks for libmysqlclient:

configure:60738: checking for mysql_close in -lmysqlclient
configure:60757: gcc -o conftest -I/usr/local/include -g -O2 -fvisibility=hidden -Wl,-rpath,/usr/lib/mysql -L/usr/lib/mysql -L/usr/local/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -lmysqlclient -lmcrypt -lltdl -lcrypt -lpam -liconv -lfreetype -lpng -lz -ljpeg -lcurl -lz -lpcre -lrt -lm -ldl -lnsl -lxml2 -lz -liconv -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -lz -liconv -lm -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto 1>&5
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 60746 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char mysql_close();

int main() {
mysql_close()
; return 0; }
configure:60980: checking for mysql_error in -lmysqlclient
configure:60999: gcc -o conftest -I/usr/local/include -g -O2 -fvisibility=hidden -Wl,-rpath,/usr/lib/mysql -L/usr/lib/mysql -L/usr/local/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient -lz -lmcrypt -lltdl -lcrypt -lpam -liconv -lfreetype -lpng -lz -ljpeg -lcurl -lz -lpcre -lrt -lm -ldl -lnsl -lxml2 -lz -liconv -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -lz -liconv -lm -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto 1>&5
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 60988 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char mysql_error();

int main() {
mysql_error()
; return 0; }

As a workaround, I've set the configure options to use mysqlnd:

        --with-mysql=mysqlnd \
        --with-mysqli=mysqlnd \
        --with-pdo-mysql=mysqlnd \

So, I've been unable to configure php ( 5.3.27 ) with libperconaserverclient as libmysqlclient, but at least I have found a workaround.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

a) I wonder if php build is using mysql_config there (to get libs) or if it is hardcoded.

b) If not, then you can use mysql-libs-5.5.36 available from other repos: http://pkgs.org/search/?keyword=libmysqlclient.so.18
But this may not work due to the bug in -shared-55 package where it also 'provides' mysql-libs.

c) ln -s from libperconaserverclient to libmysqlclient.so.18 should act as workaround.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Rene,

  --with-mysqli=FILE Include MySQLi support. FILE is the path
                          to mysql_config. If no value or mysqlnd is passed
                          as FILE, the MySQL native driver will be used

so --with-mysqli=/usr/bin/mysql_config should do.

(for other two options you need to pass mysql base directory).

Revision history for this message
René Diepstraten (rene-renediepstraten) wrote :

It seems that this change has caused the same problems for some cpanel users:
http://forums.cpanel.net/f354/issue-percona-396262.html
http://encylia.com/2014/03/11/percona-update-causing-problems-for-php-and-cpanel/

@Raghavendra:

I've been able to compile php with two symlinks:
ln -s libperconaserverclients.so.18 libmysqlclient.so.18
ln -s libperconaserverclients.so libmysqlclient.so

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Rene,

Thanks, is it common in apache/php to build from source (than install appropriate packages). Reading from that forum seemed to indicate 'easyapache' is used to rebuild php against mysql libraries. Is that right?

One more thing, rebuilding against libmysqlclient.so.16 (-shared-51) should be fine unless you are using any feature of 5.5 client libaries. (The applications in centos6 repo are built against .16 for now).

Revision history for this message
Mike Loseke (mike-tummy) wrote :

Percona-Server-shared-55-5.5.36-rel34.2.el6.x86_64 still provides "libmysqlclient.so.18":

    # rpm -q --provides Percona-Server-shared-55-5.5.36-rel34.2.el6.x86_64
    libmysqlclient.so.18()(64bit)
    libperconaserverclient.so.18()(64bit)
    libperconaserverclient.so.18(libperconaserverclient_16)(64bit)
    libperconaserverclient.so.18(libperconaserverclient_18)(64bit)
    Percona-Server-shared-55 = 5.5.36-rel34.2.el6
    Percona-Server-shared-55(x86-64) = 5.5.36-rel34.2.el6

Is there a fix in line for this?

Revision history for this message
Tomislav Plavcic (tplavcic) wrote :

This is because symlinks are created for libmysqlclient for compatibility.

Revision history for this message
monty solomon (monty+launchpad) wrote :

This bug appears to be related to bug 1199534.

Revision history for this message
monty solomon (monty+launchpad) wrote :

Percona-Server-shared-55-5.5.36-rel34.2.el6.x86_64 is not available.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3103

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.