出错:
import MySQLdb
Traceback (most recent call last):
File "./mysqldataImport.py", line 6, in ?
import MySQLdb
File "/usr/lib/python2.3/site-packages/MySQLdb/__init__.py", line 27, in ?
import _mysql
ImportError: libmysqlclient_r.so.15: cannot open shared object file: No such
file or directory
我发现libmysqlclient_r.so.15在/usr/local/mysql/lib目录下,请问我该怎么做才能让
Python发现这个库文件?
解决方法(我实验过能行!):
一,
把/usr/local/mysql/lib加到LD_LIBRARY_PATH环境变量中(注意把~变成绝对路径)
#export LD_LIBRARY_PATH=/usr/local/mysql-5.0.51a-linux-i686-glibc23/lib
# vi /etc/ld.so.conf
//加入
/usr/local/mysql-5.0.51a-linux-i686-glibc23/lib
#ldconfig -v //OK!!!
阅读(754) | 评论(0) | 转发(0) |