Ken Ingle

Ken Ingle

Chief Information Officer, Technology & Strategic Leader

Python and MySQL on Mac OSX

I ran into a problem today I hadn’t experienced in a long time. I was trying to get mysql-python installed when running the .dmg for MySQL and it kept giving the following error:

EnvironmentError: mysql_config not found
After a bit of refreshing my memory I remembered that it was actually pretty simple to fix. The mac is a little different in where it stores the mysql_config file. Just run the following command from and all is good:

You will then need to add a symlink to the libmysqlclient in /usr/lib:

Then you can run pip install mysql-python.