这一行起什么作用?

这一行起什么作用?

我正在尝试让 MySQL-python 在我的 Mac 上运行。我必须在终端中输入此行来修复错误,具体来说是“未找到 _mysql.so 映像”。此行的来源告诉我,我应该将其放入我的 .profile 中,以便永久保留。

我感兴趣的是了解错误到底是什么原因造成的,而不是快速修复。这一行代码到底起什么作用?

export DYLD_LIBRARY_PATH=”$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/

答案1

它附加/usr/local/mysql/lib/DYLD_LIBRARY_PATH环境变量

DYLD_LIBRARY_PATH

          This is a colon separated list of directories  that  contain  libraries.  The  dynamic  linker
          searches  these  directories before it searches the default locations for libraries. It allows
          you to test new versions of existing libraries.

          For each library that a program uses, the dynamic linker looks for it  in  each  directory  in
          DYLD_LIBRARY_PATH  in  turn.  If  it still can't find the library, it then searches DYLD_FALL-
          BACK_FRAMEWORK_PATH and DYLD_FALLBACK_LIBRARY_PATH in turn.

          Use the -L option to otool(1).  to discover the frameworks and shared libraries that the  exe-
          cutable is linked against.

http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/dyld.1.html

PS:可能你在某处丢失了一个结束的双引号字符

相关内容