1、mysqldb模块
python
http://sourceforge.net/projects/mysql-python/
2、解压安装mysql
解压sql
vi setup_posix.pyshell
mysql_config.path = "/usr/local/mysql/bin/mysql_config".net
sudo python setup.py installcode
3、验证orm
Harry:MySQL-python-1.2.4b4 harry$ python Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb
此时会报错,须要创建软链接it
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib