装python + apache + django过程中真是一个问题加一个问题啊,刚刚解决完一个,又来一个
Error loading MySQLdb module: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
后来上网找了半天 看到 http://sourceforge.net/projects/mysql-python/forums/forum/70461/topic/3450226
有这么一个回复
nstead of changing your LD_LIBRARY_PATH you should set "runtime_library_dirs" to point to your library path on the destination system in the setup_posix.py before compiling.
eg. like this:
编译成功后,运行程序,出现./connect: error while loading shared libraries:
libmysqlclient.so.15: cannot open shared object file: No such file or directory.
出现上面的错误是因为系统运行的时候没有找到程序运行所需要的libmysqlclient.so.15运行库文件,解决方法有两个:
方法一:直接把libmysqlclient.so.15这个文件拷贝到系统指定的/usr/lib库文件目录中。
方法二:设置/etc/ld.so.conf文件,编辑该文件,在文件中加入libmysqlclient.so.15所在目录,保存退出。
需要注意的是,每次改动ld.so.conf之后需要运行ldconfig来确认刷新。
方法三:Add /usr/local/mysql/lib/mysql to you LD_LIBRARY_PATH environment variable

在配置Python、Apache和Django环境时遇到问题,具体表现为Error loading MySQLdb模块,提示libmysqlclient_r.so.16共享对象文件找不到。解决方案是在setup_posix.py中设置'runtime_library_dirs'指向库路径。
1161

被折叠的 条评论
为什么被折叠?



