Today, I tried to install mysql client library for python. I got client library from http://sourceforge.net/projects/mysql-python . After download and I change mysql_config in site.cfg. I gave
mysql_config= /Application/MAMP/library/bin/mysql_config
and then
$python setyp.py clean
$python setyp.py build
and the I got many errors.
gcc-4.0 failed with exit code 1
I didn’t know Why occur like that. Most of .c files are not found in error message. So, I search in My Mac and I couldn’t find it. I decied to install mysql 5 again. Only client library not include server.
sudo port install mysql5
After installation, I change site.cfg like that
mysql_config = /opt/local/lib/mysql5/bin/mysql_config
after that
$python setup.py clean
$sudo python setup.py build
$sudo python setup.py install
No problem. So, I tried in python from terminal
>>import MySQLdb
I got error again. There is no sock in /opt/local/var/run/mysql5/mysqld.sock
Ok. We can make from MAMP sock. I add following code in terminal
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /opt/local/var/run/mysql5/mysqld.sock
After that, I tried again in python and connect mysql database that from MAMP. Yayyy… it’s working fine.



