安装MySQLdb

MySQLdb模块不太好装,如果是在python2.7环境下,可以使用一种简易安装方式

root@iZ2893wjzgyZ:~# apt-get install python2.7-mysqldb

测试可知:

root@iZ2893wjzgyZ:~# python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>
原文地址:https://www.cnblogs.com/alexkn/p/4295913.html