k5qsdw
Last Updated: February 25, 2016
·
5.709K
· pzgz

Library Not Loaded issue for mysql client on Mac OS

On Mac OS Lion, with mysql installed from source, might get following error when trying to access mysql from rails:

Library not loaded: libmysqlclient.18.dylib (LoadError)

There are two solutons:

  • Put export DLYD_LIBRARY_PATH=/usr/local/mysql/lib into bash profile, somehow, it will raise warning time to time in Lion and ML: 'dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/osascript) is code signed with entitlements', things like that.

  • Run sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib, this works for me.

I bet there must be a better solution to do with the compile options when build from mysql source, untill them, second solution will work for me.

4 Responses
Add your response

14830

Thank you! It really saved my lot of time.

over 1 year ago ·
15266

I had recompiled about 5 times with different load options - this finally worked, but why it works I don't know, but thanks!

over 1 year ago ·
17606

+1 thank you!

over 1 year ago ·
25062

did not work for me on OSX Yosemite(

over 1 year ago ·