Resources:
Mac OS X Python installation mysqldb module http://www.codeif.com/post/1073/
MAC OSX uses Python to install modules for issues http://www.myexception.cn/operating-system/1616547.html
MySQL and Django are installed in Mac OS X, and when you access the MySQL database in Django, you are prompted with "Importerror:no module named MySQLdb", is because there is no MYSQLDB library installed for Python to connect to MySQL. In order to solve a series of problems, access to information, it took two hours to fix ...
download mysqldb at URL http://sourceforge.net/projects/mysql-python/ .
Straight then double-click Unzip, command line into the extracted directory, execute python setup.py build , appears " Environmenterror:mysql_config not found "Error
According to the prompt, you need to edit the path of the MySQL, first find the local MySQL path
Using VIM, open the setup_posix.py in the Mysql-python installation file to find“mysql_config.path = "mysql_config"”改为
Perform
Error occurred "Error:command ' CC ' failed with exit status 1"
Use Archflags to downgrade the error to warning
Installation Successful Mysql-python
When importing the MySQLdb module, there is an error:
To add a soft link:
Can eventually be used normally.