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.
Written by Leon Guan
Related protips
4 Responses
Thank you! It really saved my lot of time.
I had recompiled about 5 times with different load options - this finally worked, but why it works I don't know, but thanks!
+1 thank you!
did not work for me on OSX Yosemite(