I'm putting together a script that has a requirement of knowing libmysqlclient.so.[15|16|18] .so file. It's usually located in /usr/lib/ , /usr/lib64/ or a mysql/ subdirectory of the aforementioned directories.
I have tried a few things. First of all, sometimes the location can be found in a mysql file in /etc/ld.so.conf.d/mysql* , but that has not been the case on many servers.
Another possibility is searching the above directories for those files. I will know which version of MySQL is being used, so I can search for the proper .so file, but unfortunately many people seem to have multiple .so's installed. For example both may exist:
/usr/lib/libmysqlclient.so.15
/usr/lib64/libmysqlclient.so.15
In this situation, I'm not sure which .so file is being used.
Is there anyway to tell where the proper libmysqlclient.so is installed?