To connect to a MySQL database from Django or a python script you have to install MySQLdb. The installation of the package on MacOSX is not straightforward, so here is a small howto.
mysql_config.path = "mysql_config" to mysql_config.path = "/usr/local/mysql/bin/mysql_config"
Note: you have to specify the path to your mysql_config unless you have installed mysql.com package for mac
python setu.py clean python setup.py build sudo python setup.py install
If you get this compile error
/usr/include/sys/types.h:92: error: duplicate ‘unsigned’ /usr/include/sys/types.h:92: error: two or more data types in declaration specifiers
edit the _mysql.c file and comment this line
#define uint unsigned int
One Response
Blogimus
14|May|2008 1Thanks!
This fix got me past my first build problem of the compile error.
I’m building on an iMac G5 running 10.5 Leopard .
I now have the wrong arch warning:
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.a, file is not of required architecture
so my next step is to fix the arch parameters to support ppc64.
Leave a reply