I confirm patch from Abhishek DOESdoes work.
it work for Yosemite, too.
note: instead of linking to a particular version of mysql, use the fact mysql already built symlink:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib this solution does work for Xcode and C API.