1

Current situation

I'd like to install XtraBackup on my VPS (Centos 5) where my main database is running. During the rpm install it told me that it misses a dependency called perl(DBD::mysql).

When I try to yum install that dependency, it tells me this:

Error: Missing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by package perl-DBD-MySQL-3.0007-2.el5.x86_64 (base) Error: Missing Dependency: libmysqlclient.so.15()(64bit) is needed by package perl-DBD-MySQL-3.0007-2.el5.x86_64 (base)

When I check /usr/lib/mysql a couple of non existent symlinks called libmysqlclient.so.15 are there. The only working symlinks are libmysqlclient.so and libmysqlclient_r.so and they are linked to /usr/lib64/libmysqlclient.so which is a symlink to libmysqlclient.so.18.

It seems I only have version 18 installed.

Previous situation

I also installed XtraBackup on another VPS (Centos 6) of mine. Exactly the same error occured there. It at last fixed it by downloading the shared compat 5.1 lib of mysql (MySQL-shared-compat-5.1) which covered different versions of the libs, 12 until 16 I believe.

After that I could install MySQL-shared-compat-5.1 and XtraBackup nicely. The only problem that remained was that PHP uses the libmysqlclient.so.18 file, and thus the httpd service wouldn't start anymore. I fixed that with a (I think) dirty fix... By just creating a symlink libmysqlclient.so.18 -> libmysqlclient.so.16. After that apache loaded without problems. Still it doesn't feel right at all.

I'm not too experienced with most of this stuff, so I hope someone can explain me what the right fix is, to get both Apache and XtraBackup running with their versions of the libmysqlclient, if possible at all.

Martin
  • 177
  • 2
  • 10

1 Answers1

1

MySQL client libraries are tied to the version of MySQL from which they are built. The Perl's DBD::mysql library is compiled against the MySQL client libraries available when it is built. When Redhat (and, by extension, CentOS) build the RPMs, they build them from the source provided at build time.

CentOS 5's default MySQL install comes with MySQL 5.0.95, which provides libmysqlclient.so.15. It appears that your system has a newer version of MySQL installed. If you're using Percona's XtraBackup, you may be running Percona Server instead (Percona Server is an updated build of MySQL put out by Percona).

You have a few options:

  1. If Percona Server is installed via RPM:
    Install the Percona-Server-shared-compat RPM from Percona's repositories

  2. If a newer version of MySQL is installed via RPM:
    Try to find a compatibility library similar to what you did under CentOS 6.

  3. If a newer version of MySQL is installed by hand:
    Recompile the perl-DBD-mysql source RPM on a system with the libmysqlclient.so.18 file and associated development headers and then install the resulting binary. CentOS provides instructions for rebuilding from a source RPM. Alternately, you can also download and install Percona XtraBackup from source as well.

CentOS (and RHEL) sort of expect that all of the software you install will be installed using RPMs and yum. When you go outside of this, you run the risk of not being able to use RPMs anymore for software linked to your custom installs. It sounds like that is the case here because not only do you not have a suitable version of perl-DBD-mysql available, but you also have PHP linked against the newer version of MySQL as well.

hrunting
  • 943
  • 4
  • 7
  • Thanks a lot for your answer, this clears up a lot of doubts. I hope to use one of these answers soon. Currently I don't have the time, unfortunately. I hope to be able to accept your answer soon! – Martin Jan 30 '14 at 11:46