1

I did brew remove mysql. After, i reinstall mysql from dmg again. But now i cant run my django project. It shows me:

ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/polinom/workspace/agents/eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.so, 2): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
  Referenced from: /Users/polinom/workspace/agents/eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.so
  Reason: image not found

This does not help: sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib

And this does not help: export DLYD_LIBRARY_PATH=/usr/local/mysql/lib

I figured out that there is no file /usr/local/lib/libmysqlclient.18.dylib. Even here it is absent /usr/local/mysql/lib/. The only libs that sit in that folder is:

libmysqlclient.15.dylib    libmysqlclient_r.15.dylib  libndbclient.2.dylib       libndbclient.la
libmysqlclient.dylib       libmysqlclient_r.dylib     libndbclient.dylib

What do i do about that?

Pol
  • 24,517
  • 28
  • 74
  • 95
  • I did not understood the question – Pol Jun 01 '12 at 15:15
  • Is there a file named libmysqlclient.18.dylib under dir Cellar `ls -al /usr/local/lib/libmysqlclient.18.dylib lrwxr-xr-x 1 imom0 admin 50 May 29 19:25 /usr/local/lib/libmysqlclient.18.dylib -> ../Cellar/mysql/5.5.24/lib/libmysqlclient.18.dylib` – iMom0 Jun 01 '12 at 15:17
  • No there is no such file. The only files that are there is the ones i wrote about in question. Looks like I have newer version libndbclient.2.dylib. Byt how do i connect it to python? – Pol Jun 01 '12 at 15:20

1 Answers1

1

If you installed from a DMG this time, try looking in /usr/local/ for a file like

mysql-5.5.24-osx10.6-x86_64

If you have that version or newer, libmysqlclient.18.dylib will be in there, and you just need to make sure that your symlink to /usr/local/mysql is correctly linking to that version. You may also have to add it to your path, the DMG installer did a horrible job of setting that stuff up for me.

If you have an earlier version than the one above, you may need to grab a newer copy of the DMG and reinstall. Hope this helps!

Murph
  • 511
  • 7
  • 16
  • I just figured out by my self that i had wrong version of MySQL server. I installed 5.2 but suppose to 5.5.25. But i steel have a problem. `/usr/local/mysql/lib//libmysqlclient.18.dylib: mach-o, but wrong architecture` – Pol Jun 01 '12 at 16:00
  • 1
    Did you try looking at the answer to this [question](http://stackoverflow.com/questions/8677591/cant-load-mysqlclient-18-dylib-into-python-on-mac-os-lion)? Seems like a similar issue at this point. – Murph Jun 01 '12 at 16:07
  • I could not find appropriate. – Pol Jun 01 '12 at 16:09
  • Try using ```arch -x86_64 python``` and ```arch -i386 python``` to run your django project. If one of those works and the other one gives you this error, then you need to repair the default python architecture. It may have gotten messed up if the brew version and the DMG version of mysql were different architectures. – Murph Jun 01 '12 at 16:16
  • I resolved that. Just installed 64 bit version of MySQL. Thanks for help! – Pol Jun 01 '12 at 17:43