LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-05-2010, 08:12 PM   #1
IHeartLinux
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Rep: Reputation: 0
Unhappy libmysqlclient_r.so.15 ??


Hey guys!

Today I'm installing MySQL for my Django server! Hooray!

I installed:
MySQL-server-5.1.48-1.glibc23.i386.rpm
MySQL-client-5.1.48-1.glibc23.i386.rpm
and can now type "MySQL" at the command prompt to play around with MySQL! W00t!


However, when trying to import MySQLdb into python, I get this error:
>>> import MySQLdb
ImportError: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory

... and now I'm clueless. I tried looking for libmysqlclient_r.so.15 by typing "sudo find / -name 'libmysqlclient_r.so.15'" and didn't get anything


PLEASE can anyone help me???
 
Old 07-05-2010, 08:55 PM   #2
rk4n3
LQ Newbie
 
Registered: Jul 2008
Location: MN
Distribution: Freenix
Posts: 15
Blog Entries: 1

Rep: Reputation: 2
This appears to be a situation where some software has
linked explicitly to that version (15) of the mysql client
library.

This may not be a "perfect" solution, but most times that
a fairly stable API is representing in a shared library,
the individual versions don't change the API's signatures,
and software compiled to use it doesn't necessarily care
what version is being used. Because of this, it can
sometimes help to "masquerade" the current version of
the library as the "old" one that is being looked for.
This is done by providing a symbolic link to the new
library, named as the old library.

Find your libmysqlclient<whatever>.so file, that you *do*
have on your system, and create a symbolic link to that
file, and name the link "libmysqlclient_r.so.15".

Do a "man ln" to see details of the ln command. You'll
want to use the "-s" parameter to get a symbolic link.

Give it a try, and post back if it doesn't work, and
we may be able to track down something else.
 
Old 07-05-2010, 10:06 PM   #3
IHeartLinux
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the reply!

I tried what you said, and found out I have:
/usr/lib/libmysqlclient_r.so.16
/usr/lib/libmysqlclient.so
/usr/lib/libmysqlclient_r.so.16.0.0
/usr/lib/libmysqlclient.so.16.0.0
/usr/lib/libmysqlclient_r.so
/usr/lib/libmysqlclient.so.16
so now that I know what to create the symbolic link to... where should I make the symbolic link?

Thanks!
 
Old 07-06-2010, 09:10 PM   #4
IHeartLinux
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Also, I heard something about recompiling MySQL? Would that fix it as well?...
 
Old 07-06-2010, 09:59 PM   #5
IHeartLinux
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Oh, I get this error when trying to import MySQLdb:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/MySQLdb/__init__.py", line 19, in <module>
import _mysql
File "/usr/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/_mysql.py", line 7, in <module>
File "/usr/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-linux-i686.egg/_mysql.py", line 6, in __bootstrap__
ImportError: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory
I tried creating a symbolic link in /usr/lib/python2.6/site-packages/MySQLdb as follows:
sudo ln -s /usr/lib/mysql/libmysqlclient_r.so.16 libmysqlclient_r.so.15
sudo ln -s /usr/lib/mysql/libmysqlclient_r.so.16.0.0 libmysqlclient_r.so.15.0.0
and I still get the same error...sigh...

Linux can be frustrating...
 
Old 07-10-2010, 12:20 PM   #6
IHeartLinux
LQ Newbie
 
Registered: Jul 2010
Posts: 8

Original Poster
Rep: Reputation: 0
I hate to bump this post, but I still have no idea how to fix this problem...

Any help?
 
Old 07-10-2010, 12:38 PM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You should create the symlinks into a directory where they can be found by your app:
Code:
sudo ln -s /usr/lib/mysql/libmysqlclient_r.so.16 /usr/lib/libmysqlclient_r.so.15
sudo ln -s /usr/lib/mysql/libmysqlclient_r.so.16.0.0 /usr/lib/libmysqlclient_r.so.15.0.0
Do the same also for libmysqlclient.so.16.0.0 and libmysqlclient.so.16.0

If that doesn't work you can downgrade mysql to 5.0.x version that provides the correct client library

Regards
 
Old 07-28-2010, 01:23 AM   #8
rk4n3
LQ Newbie
 
Registered: Jul 2008
Location: MN
Distribution: Freenix
Posts: 15
Blog Entries: 1

Rep: Reputation: 2
yes, sorry it took me so long to get back to this...

bathory is correct - in case it wasn't clear enough, the links
that you create have to be in a path that is searched by the
library load. You can either create these links beside their
originals in the directory they live in (/usr/lib/mysql), or
you can create the links in your own directory, perhaps in
/path/to/your/program/source, and then add that directory to
your LD_LIBRARY_PATH environment variable:

export LD_LIBRARY_PATH=/path/to/your/program/source:$LD_LIBRARY_PATH

I find the first option most straightforward, but the second
option can be helpful if you don't have root access to write
to the original directory, or if you just don't want to mess
with your "system setup".

Hopefully this clears things up - let us know if you run into
further difficulties...
 
Old 02-23-2011, 09:09 AM   #9
kriengten
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Wink lazarus libmysqlclient.so.15 error

sudo ln -s /usr/lib/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so.15

it work for me in ubuntu 10.10
 
Old 06-21-2011, 08:26 AM   #10
mignonnedavis
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Rep: Reputation: 0
Hi I have what looks like an identical problem, but the solution presented doesn't seem to make any difference.
My error is: ImportError: libmysqlclient_r.so.15: cannot open shared object file: No such
file or directory
I have added the symbolic links in /usr/lib as follows:

[root@server lib]# ls -al *15*

lrwxrwxrwx 1 root root 37 Jun 21 01:59 libmysqlclient_r.so.15 -> /usr/lib/mysql/libmysqlclient_r.so.16
lrwxrwxrwx 1 root root 41 Jun 21 01:59 libmysqlclient_r.so.15.0.0 -> /usr/lib/mysql/libmysqlclient_r.so.16.0.0
lrwxrwxrwx 1 root root 35 Jun 21 02:00 libmysqlclient.so.15 -> /usr/lib/mysql/libmysqlclient.so.16
lrwxrwxrwx 1 root root 39 Jun 21 02:01 libmysqlclient.so.15.0.0 -> /usr/lib/mysql/libmysqlclient.so.16.0.0

I still get the error.

I am confused by the ldd command as well. If I do:


[root@server lib]# ldd libmysqlclient_r.so.15
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/libpthread.so.0 (0xf7d71000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xf7d3f000)
libnsl.so.1 => /lib/libnsl.so.1 (0xf7d26000)
libm.so.6 => /lib/libm.so.6 (0xf7cfd000)
libz.so.1 => /usr/lib/libz.so.1 (0xf7ce9000)
libssl.so.6 => /lib/libssl.so.6 (0xf7ca1000)
libcrypto.so.6 => /lib/libcrypto.so.6 (0xf7b60000)
libc.so.6 => /lib/libc.so.6 (0xf7a07000)
/lib/ld-linux.so.2 (0x00460000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xf79da000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xf7942000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0xf793f000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xf7918000)
libresolv.so.2 => /lib/libresolv.so.2 (0xf7904000)
libdl.so.2 => /lib/libdl.so.2 (0xf78ff000)
libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xf78f5000)
libkeyutils.so.1 => /lib/libkeyutils.so.1 (0xf78f2000)
libselinux.so.1 => /lib/libselinux.so.1 (0xf78da000)
libsepol.so.1 => /lib/libsepol.so.1 (0xf7894000)

None of these say anything about libmysqlclient_r.so.15 I don't really get this command at all. Can anyone see anything I'm doing wrong or that I should try now?
 
Old 06-21-2011, 02:38 PM   #11
mignonnedavis
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Rep: Reputation: 0
I guess I'm not supposed to post a kind of new question this way. I'll just start a new thread instead.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Workbench: Couldn't load library libmysqlclient_r.so Ellops Linux - Software 5 11-04-2009 03:47 PM
make error : incompatible /usr/lib64/mysql/libmysqlclient_r.a when searching for -lmy hotsouce Red Hat 3 03-26-2009 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration