Menu

error importing MySQLdb

Help
2003-02-18
2012-09-19
  • Xavier Martin

    Xavier Martin - 2003-02-18

    Hi,
    When I try to import MySQLdb pythonthrows this error:

    Traceback (most recent call last):
      File "./prova_mysql.py", line 2, in ?
        import MySQLdb
      File "/usr/lib/python2.2/site-packages/MySQLdb/__init__.py", line 27, in ?
        import _mysql
    ImportError: /usr/lib/libmysqlclient_r.so.11: undefined symbol: ERR_get_error_line_data

    I've got mysql 4.0.7 and mysql-python 0.9.2. and

    Anyone can help me?

    xavi

     
    • Andy Dustman

      Andy Dustman - 2003-03-08

      Turns out you need to link against libcrypto from OpenSSL with MySQL 4.0. Add "crypto" to the list of libraries in setup.py. I'll have to think about a better long-term fix.

       
      • Bob Ourso

        Bob Ourso - 2003-03-08

        Thanks for the info...I'll give that a try...

         
    • Anonymous

      Anonymous - 2003-03-24

      Has anyone had any luck with this yet?? I removed my faulty installation (same error as Mr. Martin above) and reinstalled after making this change to setup.py :
      ---
      # MySQL-3.23 and newer need libz
      - libraries = [mysqlclient, "z"]
      + libraries = [mysqlclient, "z", "crypto"]
      ---

      Now, I'm getting this error:
      >>> import MySQLdb
      Traceback (most recent call last):
        File "<stdin>", line 1, in ?
        File "/usr/local/lib/python2.2/site-packages/MySQLdb/__init__.py", line 27, in ?
          import _mysql
      ImportError: /usr/local/lib/mysql/libmysqlclient_r.so.12: Undefined symbol "SSL_set_fd"
      >>>

      Any tips or help would be greatly appreciated.

      K.C.

       
    • Jeremy Cowgar

      Jeremy Cowgar - 2003-03-26

      Ah! I got it to work for me. The same way you added crypto, add ssl.

      libraries = [mysqlclient, "z", "crypto", "ssl"]

       

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.