Menu

Problems: libmysqlclient_r.so with OpeSolaris

Help
2009-01-08
2012-09-19
  • Matt Kameron

    Matt Kameron - 2009-01-08

    Hi,

    I'm using OpenSolaris (a Joyent accelerator)

    Basically, the build and install works, but when I run a Python script:

    import sys, MySQLdb

    I get the error:

    ... in PIL/init.py in <module>
    ... in /egg/mysql.py in <module>
    ... in /egg/_mysql.py in _bootstrap

    ImportError: ld.so.1: python2.5: fatal: libmysqlclient_r.so.15: open failed: No such file or directory.

    I'm using Python 2.5.2, MySQL 5.0.67 and MySQL-python-1.2.2.

    Would anybody please be able to help me with this issue?

    Thanks,
    Matt

     
    • Matt Kameron

      Matt Kameron - 2009-01-24

      WOW, AWESOME, thanks Michael!
      This worked perfectly!
      =) =) =)

      Here is the exact solution that worked for me (for the benefit of future users):

      1. su to root [su].

      2. Backed up the existing ld.config file [cp /var/ld/ld.config /var/ld/ld.config-backup].

      3. Edited the file [emacs /var/ld/ld.config]. Looked through it for the directory sections and added the path I wanted [/opt/local/lib/mysql] to the list, separated by colons. I ignored the rest of the gunk in the file.

      4. Saved the file, closed, ran python. It worked!

      Step 3 could probably have been replaced with using the 'crle' tool that Michael describes above.

       
    • Matt Kameron

      Matt Kameron - 2009-01-12

      bump... can anybody even point me in the right direction here? Anything at all would be appreciated =)

       
      • Andy Dustman

        Andy Dustman - 2009-01-12

        libmysqlclient_r.so is one of MySQL shared libraries. Apparently it's not on your loader's path. Copy it around or set the loader path. There should be a distutils/setuptools option for this. Or... are you sure everything was built with no errors?

         
        • Matt Kameron

          Matt Kameron - 2009-01-18

          Thanks -

          I don't know how to manipulate my loader's path or to use distutils/setuptools.

          I tried doing export CLASSPATH= etc and also I tried adding it to my python path using sys.path.append. However, neither seemed to work.

          (the file resides in /opt/local/lib/mysql/)

          Could you give me a quick description of how I'd add these thingos to my loader's path? Or if copying it is an option, where to copy them to?

           
    • Matt Kameron

      Matt Kameron - 2009-01-18

      Thanks -

      I don't know how to manipulate my loader's path or to use distutils/setuptools.

      I tried doing export CLASSPATH= etc and also I tried adding it to my python path using sys.path.append. However, neither seemed to work.

      (the file resides in /opt/local/lib/mysql/)

      Could you give me a quick description of how I'd add these thingos to my loader's path? Or if copying it is an option, where to copy them to?

       
    • Michael Backhaus

      I ran into the same problem and eventually found the root of the problem:

      the link library path is handled in Solaris not with $LD_LIBRARY_PATH but with 'crle' - their runtime linking environment configuration. With this tool you can generate a /var/ld/ld.config and add the according directory (for me this was /opt/mysql/mysql/lib/). After that the ld.so.1 error was gone and I can import MySQLdb. :)

      Cheers,
      Michael

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.