Today's computer reload system, all the software is re-installed, MYSQLDB module has been installed bad, tangled for a long time, finally solved, methods to share to everyone. MYSQLDB Module Installation:
1, download Mysql-pyhon module, the website is: https://pypi.python.org/pypi/MySQL-python/
2, decompression, enter the directory, modify the Site.cfg file 13 lines, uncomment, the original path mysql_config =/usr/local/bin/mysql_config, changed to a new Mysql_config =/usr/local/mysql/ Bin/mysql_config (mysql_config path, not known can use the Whereis Command query path), save;
3, modify the setup_posix.py file 27th line, the original path Mysql_config.path = "Mysql_config" changed to Mysql_config.path = "/usr/local/mysql/bin/mysql_ Config ", save;
4, the Export dyld_library_path=/usr/local/mysql/lib/(path for the MySQL installation path, the completion of their own MySQL installation path can be) to join the current user home directory. Bash_profile or/etc/ Profile file,. bash_profile is the environment variable for the currently logged-on user,/etc/profile is the system environment variable, and then executes the command soure. Bash_profile or Source/etc/profile;
5, install, execute Python setup.py build and python setup.py install;
6, verification, enter the Python interactive command line, import MySQLdb, no error is installed success;
7. This solution is suitable for MacOSX, Centos, Redhat, Ubuntu, Windows.
Resolve Python2 Installation Mysql-python module error