libmysqlclient.so.16 - cannot open shared object file
14 Jul 2009
This is another post under the "simple solutions to annoying problems" category. I was deploying a Rails app to a server on which I'd compiled MySQL from source. The deployment went fine until the deploy:migrate task:
The problem was that I'd compiled MySQL with --prefix=/usr/local/mysql and that directory wasn't on the runtime linker path. So I edited /etc/ld.so.conf and added /usr/local/mysql/lib/mysql, ran ldconfig, and voila, all was well.
This problem was a little more confusing since the Rails app itself was running fine, and running script/console worked fine too. But that was because I had added the MySQL lib path to LD_LIBRARY_PATH in /etc/profile. Anyhow, hope this helps someone!