This is completely useless if you don't want to install a connector between Python and MySQL on a Mac.
If you did need to and didn't want to spend hours searching for how to do it - this is the solution (after a stupid amount of time looking on and off over the last couple of months).
Firstly - Snow Leopard removed one of the old gcc compilers (needed to build the package). This needs to come off the installation DVD.
Secondly - MySQLdb has the wrong config path in site.cfg. You need to change it. It's in /usr/local. You need to tell it the path to the mysql config file (in bin inside the mysql install directory).
Thirdly - there's something necessary called an Arch flag. Don't know what that is.
Fourthly - MySQLdb is calling the wrong version of gcc so you need to correct that.
Therefore instructions are:
Download latest version from sourceforge.
Next modify the config path (fuller instructions here:http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/?cp=all).
Now go into the relevant directory through terminal and:
sudo python setup.py clean
sudo ARCHFLAGS=’-arch x86′ CC=/usr/bin/gcc-4.0 python setup.py build
sudo ARCHFLAGS=’-arch x86′ CC=/usr/bin/gcc-4.0 python setup.py install
sudo ARCHFLAGS=’-arch x86′ CC=/usr/bin/gcc-4.0 python setup.py build
sudo ARCHFLAGS=’-arch x86′ CC=/usr/bin/gcc-4.0 python setup.py install
Overly complicated but worked in the end.
Found the instructions in the comments halfway down the article linked.
No comments:
Post a Comment