Menu

Problems on OS X

Help
2002-11-19
2012-09-19
  • Geoff Leyland

    Geoff Leyland - 2002-11-19

    Hi, I've previously had several versions of mysqldb running on a few versions of OS X with a few versions of MySQL.
    Now, trying with Mac OS 10.2.2, python 2.1.3, mysql 4.0.4 and MySQLdb 0.9.2, I can build alright, but (with and without thread_safe_library), I get this:

    [host:~] me% /usr/local/bin/python
    Python 2.1.3 (#1, Nov 14 2002, 14:45:50)
    [GCC 3.1 20020420 (prerelease)] on darwin6
    Type "copyright", "credits" or "license" for more information.
    >>> import MySQLdb
    >>> lw_read_connection = MySQLdb.connect(user='xxx', db='xxx')
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/local/lib/python2.1/site-packages/MySQLdb/__init__.py", line 63, in Connect
        return apply(Connection, args, kwargs)
      File "/usr/local/lib/python2.1/site-packages/MySQLdb/connections.py", line 116, in __init__
        self.converter[types.StringType] = self.string_literal
    TypeError: object does not support item assignment

    If I try twice, I get a segmentation fault.
    Any ideas what my stupid mistake might be?
    Cheers, and thanks in advance,

    Geoff

     
    • Geoff Leyland

      Geoff Leyland - 2002-11-20

      Me answering myself,

      FWIW, mysqldb 0.9.1 seems to work find, as does Zope 2.6 and ZMySQLda with this setup.  So I'm happy with that.  But if you want more information about the bug, don't hesitate to ask.

      cheers,
      goof

       
    • Anonymous

      Anonymous - 2003-05-11

      I seem to be getting exactly this same problem.  I've got mysql 4.0.12, python 2.3a2, MySQLdb 0.9.2 running on macos10.2.6.  I also get the TypeError and eventually a Segmentation Fault. 

      I noticed that when installing MySQLdb, I had to change nearly all of the include and lib dirs in setup.py for it to work.. and since I'm not using fink, I had to change the macosx specific stuff in the later platform specific section.

      I'm not really too steady on the threadsafe vs. unsafe mysql stuff, so that could be my problem but gleyland above seems to have ruled that out for me. 

      I'll try out 0.9.1 and see how that treats me.

      ~Israel~

       
    • Christopher Cotton

      Just a question, where do you guys install MySQL? I have it installed at /Library/MySQL/

      I did this to match the other parts like Frameworks, WebServer, and other parts.

       
    • Christopher Cotton

      Ok, I tried MySQLdb 0.9.1 with Mac OSX and Python 2.3b1. I still get the same assignment error as before.

      If i put in a statement right before the assignment:
          print self._db.converter

      I get the printed "None". So it seems that the variable is not not being initialized correctly as a dictionary.

       
    • Christopher Cotton

      Ok, MySQLdb 0.9.1 works with Python 2.2. which is the standard python that ships with Mac OSX.

      MySQLdb 0.9.1 does NOT work with Python 2.3b1, which is the version you current get if you download MacPython 2.3b1 and install it.

      Unfortunately, I need the 2.3b1 in order to use wxPython.

      MySQLdb 0.9.2 does NOT work with Python 2.2 or 2.3b1.

      So, now off to see what the differences could be.

       
    • Christopher Cotton

      Ok, I solved the problem. Issue was two different sets of mysql includes. one from a previous installation of fink which was mysql 3.22, and then the real version of mysql I'm using, 4.0.

      This caused the exact same issues as above. I got the

      self.converter[types.StringType] = self.string_literal
      TypeError: object does not support item assignment

      Once I removed the spurious mysql/include and /lib that I had, everything worked.

      This is with Python 2.3b1, and the latest CVS from sourceforge. It also works with the MySQLdb 0.9.2.

      Yeah! Finally it works.

       
    • Anonymous

      Anonymous - 2003-09-03

      I got the same problem using MySQL-python v0.9.2,
      Python 2.3b1 and MySQL-4.0.14 on MacOSX 10.2

      I get the following error, whenever I try to connect to the server (no matter which host, user, password or database):

      >>> import MySQLdb
      >>> db = MySQLdb.connect(db='test')
      Traceback (most recent call last):
        File "<stdin>", line 1, in ?
        File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/MySQLdb/__init__.py", line 63, in Connect
          return apply(Connection, args, kwargs)
        File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/MySQLdb/connections.py", line 115, in __init__
          self._make_connection(args, kwargs2)
        File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/MySQLdb/connections.py", line 41, in _make_connection
          apply(super(ConnectionBase, self).__init__, args, kwargs)
      _mysql_exceptions.InternalError: (-1, 'connection is closed')

      after leaving python, I also get a malloc-warning:

      *** malloc[2023]: error for object 0x131430: Incorrect checksum for freed object - object was probably modified after being freed; break at szone_error

      Has anyone solved the problem yet? The clue from chriscotton is pointless to me, as I only have a single one mySQL instastallation.

       

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.