linux上安装MySQLdb

一,下载MySQLdb

方法1,https://sourceforge.net/projects/mysql-python/

方法2,wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download


二,解压

tar -zxvf MySQL-python-1.2.3.tar.gz


三、进入

cd MySQL-python-1.2.3


四、安装

sudo python setup.py install

若报错则执行:

sudo yum install python-devel

然后继续执行:

python setup.py install

你可能感兴趣的:(python)