Python中使用MySQL的问题

2014-11-24 17:49:11 · 作者: · 浏览: 0

第一步:安装MySQL-python-1.2.2.tar


第二步:可能遇到的错误


1、libmysqlclient.so.16: cannot open shared object file: No such file or directory


需要安装新的包mysqlclient16-5.1.30-1.el5.remi.i386


或者通过ln -s设置链接


2、 在build的时候需要按照setuptools-0.6b1-py2.4.egg包


这个按照需要上网,需要设置网络环境ip地址+DNS。


3 EnvironmentError: mysql_config not found


4 /usr/bin/ld: cannot find -lmysqlclient_r
解决方法一(已经测试通过)


解决方法二(没有测试)A thread-safe client library (libmysqlclient_r) will be created automatically during the compilation of MySQL if the configure command contains the option "--enable-thread-safe-client".