Python 2.7(64位)安装mysql数据库

1、下载mysqldb源码,https://pypi.python.org/pypi/MySQL-python/1.2.5

解压后执行 python setup.py install 
提示错误: fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

2、如果出现上述错误,需要安装MySQL connector,http://dev.mysql.com/downloads/connector/c/6.0.html#downloads,根据Python版本,下载32位或64位,默认安装即可。
3、修改site.cfg 中connector 的值。更改为connector的安装路径。
Python 2.7(64位)安装mysql数据库_第1张图片
4、执行python setup.py install
5、如果Python 是32位的,则可直接下载32位的mysqldb,https://sourceforge.net/projects/mysql-python/,双击安装即可。

你可能感兴趣的:(python,python)