MySQL & Python on Mac
I don’t have MySQL installed globally, so need to do this dance every time I add it to a new virtualenv:
- Install the bindings in the virtual env. The package name is MySQL-python.
- Symlink libmysqlclient.18.dylib from the /usr/local/mysql/lib tree into site-packages of the virtualenv
- Add the following to the virtual env’s activate script::
- DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/path/to/venv/site-package
- optionally add /usr/local/mysql/bin to PATH as well.