只能源码安装
- 源码下载:
http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/
http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download
- apt-get安装前置的配套组件:
sudo apt-get install python-setuptools
sudo apt-get install libmysqld-dev
sudo apt-get install python-dev
- 或者使用yum安装前置的配套组件
yum install python-devel
yum install mysql-devel.x86_64
- 修改配置文件:
which mysql_config
修改site.cfg中的mysql的配置, 修改为指定的路径.
- 最后执行安装命令
sudo python setup.py install # or su first
可能的错误:
error: my_config.h: No such file or directory
需要按照以上步骤安装