mysql-pythonを入れるのにいつも苦労するなぁ...ということでメモ残しておく
環境
- os 10.6 lion
やり方
MySQL-python は、
http://sourceforge.net/projects/mysql-python/
からダウンロードして展開して、mysql_configの場所が通常の場所にない人はsite.cfgを編集。
$ mysql_config = /usr/local/mysql/bin/mysql_config
で、ビルド&インストール
$ python setup.py build $ sudo python setup.py install
ちゃんとインストールできたか確認
$ python Python 2.6.7 (r267:88850, Oct 30 2011, 19:00:25) [GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.10.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import MySQLdb
やったー!