Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could try running otool to find out exactly what library paths the <code>MySQLdb</code> C extension, <code>_mysql.so</code> is looking for:</p> <pre><code>$ otool -L /Users/yanigisawa/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so </code></pre> <p>and then the installed library name of the MySQL library file:</p> <pre><code>$ otool -DX /usr/local/mysql/lib/libmysqlclient.16.dylib </code></pre> <p>But you should not have to resort to setting <code>DYLD_LIBRARY_PATH</code> (or using <code>install_name_tool</code> to modify an executable); the need to set it is almost always a sign of a component that was built or installed incorrectly. In my experience, the MySQL project does not have a very good track record for consistency in their OS X builds and installers, as that issue you cite tends to confirm.</p> <p>Trying to get a working combination of <code>Python</code>, <code>MySQLdb</code>, and <code>MySQL</code> libraries in OS X 10.6 is a very common cause of frustration: lots of questions about it here on SO and elsewhere. There are a number reasons for that. My advice is to go with a complete solution from one of the third-party distributors that will build and install compatible versions of everything you need. And it should keep working if you need to upgrade components as time goes on. I've had good success over the years with <code>MacPorts</code>; others prefer <code>Fink</code> or the newer <code>HomeBrew</code>. With <code>MacPorts</code>, after installing the base files from the MacPorts .<code>dmg</code>, you can get everything built like so:</p> <pre><code>$ sudo port selfupdate # ensure the port files are up-to-date $ sudo port install py26-mysql </code></pre> <p>The MacPorts Python will be available at <code>/opt/local/bin/python2.6</code>. If you are looking to run <code>Django</code>, there's a port for that as well.</p> <p>EDIT: With the updated output from <code>otool</code>, you can see that there is a mismatch of library path names. The MySQLdb extension is asking for a relative path name (no initial <code>/</code>), while the MySQL library advertises itself with an absolute path, normally what you want. It seems to be the reverse of the MySQL issue 59006 but, without knowing exactly what steps you've performed up until now, it is really hard to say how you got to this state. You <em>may</em> be able to use <code>install_name_tool</code> to patch the <code>_mysql.so</code> to have the absolute path name which would also eliminate any need to set <code>DYLD_LIBRARY_PATH</code>. It's worth trying:</p> <pre><code>$ cd ~/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp $ sudo install_name_tool -change libmysqlclient.16.dylib \ /usr/local/mysql/lib/libmysqlclient.16.dylib \ _mysql.so </code></pre> <p>But that should not leave you with a warm and fuzzy feeling that you can reproduce the results when you need to update something. There really is no virtue in trying to glue all these pieces from different sources into something that works.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload