原本,Python世界中有easy_install/pip等神兵利器来安装第三方包,但公司服务器没法链接外网,所以只能采用下载包手动安装的方式。为了尽量下降部署复杂度,省去xxx.so找不到的麻烦,咱们决定采用静态连接的方式来安装MySQLdb。python
CFLAGS=-fPIC ./configure --prefix=/home/neoli/usr/ --enable-static --disable-shared --with-charset=utf8 --with-extra-charsets=ascii,binary,latin1,gbk --with-collation=utf8_general_ci