perl-DBD-MySQL errors

Quick post here for a problem that other people might run into and wonder how to fix. Let’s say you have the following error:

install_driver(mysql) failed: Can't load '/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.14: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/DynaLoader.pm line 230.
at line 3
Compilation failed in require at line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./kontroll-client-5.0.x_linux-x86-2.0.1.pl line 193

Well, you probably need to symlink “libmysqlclient.so.14″ to the existing one that is most likely of a newer version.

> find / -name "libmysqlclient*"
/usr/lib64/libmysqlclient.so.15
/usr/lib64/libmysqlclient_r.so
/usr/lib64/libmysqlclient.so.15.0.0
/usr/lib64/libmysqlclient.so

So we just symlink it to fix the issue. It’s that simple.

> ln -s /usr/lib64/libmysqlclient.so.15 /usr/lib64/libmysqlclient.so.14

4 Comments »

  1. Mark R Said,

    May 7, 2009 @ 12:34 am

    Or you could just build your DBD module against the installed version of libmysqlclient.

    If you’re using a sane package manager, it should manage dependencies of this sort for you.

  2. admin Said,

    May 7, 2009 @ 7:01 am

    This came about when using MySQL-server-percona-5.0.68 on a RHEL4 server. The package manager wanted to install mysql-server-4.1.22 to solve the dependency error. So in this case, there’s absolutely no way I’m installing mysql-server-4.1.22 just because of a small mismatch in the libmysqlclient version. Otherwise I’d agree with you.

  3. Michael Fleming: This should be obvious, but.. Said,

    May 7, 2009 @ 10:43 am

    [...] I also the only person who sees “advice” like this “fix” for a library error and let out a Charlie Brown-esque “AUGH!” (Two good ways to fix this, microbrew to the commenter [...]

  4. admin Said,

    May 7, 2009 @ 11:30 am

    While this isn’t considered a “permanent fix” it is the best method to get something working as fast as possible to prevent a process from failing. Not to mention that the differences between so.14 and so.15 are so minor and do not in any way prevent the processes from not working or working incorrectly lead me to believe that you’re just another one of those tight ass admins that don’t have to work on thousands of servers and only have to play around on the accounting office’s closet rack of three old white-box servers. There are many ways to accomplish solutions – while this is not perfect, it works. I’d rather have it be the proper version but considering the limitations of the up2date system and the version of mysql running on that server, it’s the best solution. So, until you know all of the facts behind a situation I recommend you keep your opinions to your own blog.

RSS feed for comments on this post · TrackBack URI

Leave a Comment