这条线有什么作用?[导出DYLD_LIBRARY_PATH=”$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/]

Wes*_*ley 4 linux unix mysql macos

我正在尝试让 MySQL-python 在我的 Mac 上运行。我必须将此行放在终端中以修复错误,特别是“找不到 _mysql.so 图像”。这一行的来源告诉我我应该把它放在我的 .profile 中,以便它永久坚持。

我有兴趣首先了解究竟是什么导致了错误,而不仅仅是快速修复。这条线到底有什么作用?

export DYLD_LIBRARY_PATH=”$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/
Run Code Online (Sandbox Code Playgroud)

zer*_*kms 6

它附加/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.
Run Code Online (Sandbox Code Playgroud)

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

PS:大概你在某处丢失了一个结束双引号字符