一、安装xammp集成LAMP环境(高版本的是mariadb)
PHP 5.5.15 + Apache/2.4.10 + mysql 5.6.20
1. 下载并安装
#https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.3/xampp-linux-x64-1.8.3-2-installer.run
#chmod u+x xampp-linux-x64-1.8.3-2-installer.run
#/opt/lampp/lampp start
2. 设置环境变量
#vi /etc/profile 追加环境变量
export PATH=$PATH:/opt/lampp/bin/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lampp/lib
#source /etc/profile
二、 安装python模块(python2.7,不支持python3)
1. 手动下载
https://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
unzip MySQLdb-python.zip
cd MySQL-python-1.2.3
2. 修改配置文件setup_posix.py
mysql_config为绝对路径
mysql_config.path = "/opt/lampp/bin/mysql_config"
python setup.py build
python setup.py install