注意:python2.x用mysql-python,从Python3.x起,变更为mysqlclient

windows安装python的mysql驱动是so easy的:

pip install mysql-python

但是毫不意外的出错了:

_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

windows下mysql-python安装出错

一般安装运行上面的神器命令都会出错,即使在linux下也是, 直接上解决办法:
http://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载二进制安装包网站打开大概是酱紫的:
windows下mysql-python安装出错

通过ctrl+f 搜索 “mysql-python”, 然后就酱紫了:
windows下mysql-python安装出错

下载64位版本
然后运行安装:

pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl

然后稍等一下
windows下mysql-python安装出错