tags:

views:

432

answers:

2

I have had numerous headaches trying to get the MySQL APIs for Perl and Python working on my 64 bit Macbook Pro (Leopard). I installed the 64 bit version of MySQL, but Googling around now I have the impression that this could be the source of my pain. None of the various blogs and SO answers quite seem to work (for example here on SO)

Could the 64 bit MySQL install be the culprit? Can anyone confirm that they have MySQL access via Perl and/or Python on a 64 bit Mac using 64 bit MySQL? Did you do anything special or face some similar problems?

+3  A: 

32-bit and 64-bit libraries don't play nice together. So, it depends whether you're using 32-bit Perl/Python or not.

If you are, you'll need 32-bit MySQL. Chances are your Python, at least, is 32-bit, since both the Apple-shipped Python and the binaries from python.org are 32-bit only. You can build 64-bit Python (or- gasp- a 4-way i386/x86_64/ppc/ppc64 Universal Binary) from source, but unless you really need to work with absolutely huge disk files/amounts of memory (I'm talking multi-gigabyte memory maps, for example), chances are you do not need 64-bit anything right now.

dwf
thanks dwf... I will install the 32-bit MySQL and see how I go. How do I tell whether my Perl/Python MySQL access libraries are 32 or 64-bit? I downloaded the Perl library using the cpan tool and Python was built from source (on my 64-bit machine)Interesting comment on 64-bit MySQL. Seems silly now, but when I installed the 64-bit version I guess my reflex was to choose the latest and greatest
mblackwell8
``file`` will usually tell you, if you hunt down the _mysql.so or whatever the filename is called. But if you didn't explicitly install/build 64-bit versions of Perl or Python then cpan and distutils will have built them 32-bit.You may need to reinstall the mysql access libraries once you've got 32-bit MySQL installed, just to get the dynamic linkings right.
dwf
+2  A: 

You will need the 32vit vs 64bit of the MySQL client libraries to match the application you're trying to link them with. However, this not prevent you from connecting to a 64-bit install of MySQL server.

In Unix, the MySQL client libraries support multiple versions of themselves lying around; you just have to make sure the application is loading the correct one. This should be true to the Mac.

staticsan
Good point, but I think most of the binary installers for MySQL on the Mac install one or the other.
dwf