Mysql学习MySQL-Python安装问题小记
《Mysql学习MySQL-Python安装问题小记》要点: 安装完mysql-python后import加载模块提示以下错误,MYSQL应用 代码如下:ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory 于是google之,总结一下解决方法:MYSQL应用 (1)在mysql-ython的安装目录下找到site.cfg,将MYSQL应用 #mysql_config = XXXXXXXXXXXXXXXX 注释符号去掉,并填上mysql_config的地址MYSQL应用 (2)将mysql/lib下所有关于libmysqlclient的so文件软链接到/usr/lib下.MYSQL应用 ln -s /usr/local/mysql/lib/mysql/libmysqlclient* /usr/lib ldconfig 这样在加载MYSQL应用 import _mysql 的时候就不会出错了MYSQL应用 ubuntu 安装mysql-python遇到的问题 MYSQL应用 版本是python 2.6MYSQL应用 使用easy_install 安装MySQL-pythonMYSQL应用 easy_install "MySQL-python==1.2.3" 需要安装 python-devel libmysqld-dev mysql_config.path = "mysql_config"改为mysql_config的路径MYSQL应用 whereis mysql_config查找路径MYSQL应用 mysql_config.path = "/usr/bin/mysql_config"MYSQL应用 再使用 安装MySQL-python问题解决 MYSQL应用 今天在centos安装MySQL-python,结果报错,报错信息如下:MYSQL应用 Running command /home/yunpeng.jiangyp/sys/python/bin/python -c "import setuptools;__file__='/home/admin/jyp/build/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('rn','n'),__file__,'exec'))" install --single-version-externally-managed --record /tmp/pip-MH5Aya-record/install-record.txt running install running build running build_py copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb running build_ext building '_mysql' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/home/yunpeng.jiangyp/sys/python/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv _mysql.c:44:23: error: my_config.h: No such file or directory _mysql.c:46:19: error: mysql.h: No such file or directory _mysql.c:47:26: error: mysqld_error.h: No such file or directory _mysql.c:48:20: error: errmsg.h: No such file or directory _mysql.c:88: error: expected specifier-qualifier-list before ‘MYSQL' _mysql.c:102: error: expected specifier-qualifier-list before ‘MYSQL_RES' google找到答案(http://stackoverflow.com/questions/13044201/install-mysql-python-return-error-in-centos),需要先安装mysql-devel.x86_64,通过MYSQL应用 sudo yum install mysql-devel.x86_64MYSQL应用 再次安装成功MYSQL应用 [yunpeng.jiangyp@v010105 ~]$ pip install MySQL-python Downloading/unpacking MySQL-python Running setup.py egg_info for package MySQL-python Installing collected packages: MySQL-python Running setup.py install for MySQL-python building '_mysql' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv gcc -pthread -shared build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib64/mysql -L/usr/lib64 -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -lssl -lcrypto -o build/lib.linux-x86_64-2.7/_mysql.so Successfully installed MySQL-python Cleaning up... 《Mysql学习MySQL-Python安装问题小记》是否对您有启发,欢迎查看更多与《Mysql学习MySQL-Python安装问题小记》相关教程,学精学透。编程之家PHP学院为您提供精彩教程。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |