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.

This will give you all of the libmysql files recognized by the linker. The higher on the list has the higher priority and is more likely to be linked against.

/sbin/ldconfig -p | grep mysql | cut -d\> -f2

One caveat though is that since most applications link by doing a gcc -lmysqlclient they will favor a file in the ldconfig listed as libmysqlclient.so rather than .so.15 or whatever. So personally I would assume that the first libmysqlclient.so is the correct one.

Which shared object library is used depends on the user enviroment and binary that is run. If you su - USER to the user that is running the binary and then run the command ldd MYSQLBINARY | grep mysqlclient that will determine which mysqlclient library is going to be used.

By default on most Linux systems, /usr/lib (used for x86 binaries) and /usr/lib64 (used for x86_64 bit binaries).

Btw, running locate libmysqlclient.so to get a list of all the shared objects that are installed system wide (probably won't report .so files installed in user paths though).

Find the location of libmysqlclient.so.X file in Linux environments的更多相关文章

  1. Fixing “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Linux

    If you are getting this error then you probably reset the permissions on your hidden .ssh directory ...

  2. Display certain line(s) from a text file in Linux.

    Purpose: Display certain line or lines from a text file, such as : Display the 1000th line from file ...

  3. View epub and mobi File on Linux

    Calibre has stand-alone ebook viewer "ebook-viewer", start it in terminal: $ ebook-viewer ...

  4. yum安装错误:CRITICAL:yum.cli:Config Error: Error accessing file for config file:///home/linux/+

    上网搜了一下然后自己总结一份 : 出现原因:yum可能没有,或者损坏 解决: 第一步:下载   wget  http://yum.baseurl.org/download/3.2/yum-3.2.28 ...

  5. Managing IIS Log File Storage

    Managing IIS Log File Storage   You can manage the amount of server disk space that Internet Informa ...

  6. How to Run a .Jar Java File

    .jar files are used for archiving, archive unpacking. One of the essential features of jar file is l ...

  7. Linux/Unix shell 监控Oracle告警日志(monitor alter log file)

    使用shell脚本实现对Oracle数据库的监控与管理将大大简化DBA的工作负担,如常见的对实例的监控,监听的监控,告警日志的监控,以及数据库的备份,AWR report的自动邮件等.本文给出Linu ...

  8. Sharing The Application Tier File System in Oracle E-Business Suite Release 12.2

    The most current version of this document can be obtained in My Oracle Support Knowledge Document 13 ...

  9. Java-Io之文件File

    File是"文件"和"目录路径名"的抽象表示形式.File之间继承Object,实现了Serializable和Comparable接口,因此文件支持File对 ...

随机推荐

  1. java执行jar包出错:Unable to access jarfile

    java执行jar包出错:Unable to access jarfile 错误的原因有多种: 1.一般都是路径不正确.在Windows中,正确的路径类似于: java -jar "D:\W ...

  2. pta l3-3(社交集群)

    题目链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805053141925888 题意:给定n个人,以及每个人的兴趣 ...

  3. openstack(Pike 版)集群部署(五)--- Neutron 部署

    一.介绍 参照官网部署:https://docs.openstack.org/neutron/pike/install/install-rdo.html    继续上一博客进行部署:http://ww ...

  4. linux环境下的c++编程

    就C++开发工具而言,与Windows下微软(VC, VS2005等)一统天下相比,Linux/Unix下C++开发,可谓五花八门,各式各样.Emacs, vi, eclipse, anjuta,kd ...

  5. HDU-1042.N!(大数与小数相乘的乘法模拟)

    本题大意:给定一个10000以内的整数n,让你求出n!并输出. 本题思路:先初始化一个存放答案的数组ans,初始ans[0] = 1,并初始化其剩下的元素为0,接着就从2开始依次与ans数组内的每一个 ...

  6. POJ-3279.Fliptile(二进制状态压缩 + dfs) 子集生成

    昨天晚上12点刷到的这个题,一开始一位是BFS,但是一直没有思路.后来推了一下发现只需要依次枚举第一行的所有翻转状态然后再对每个情况的其它田地翻转进行暴力dfs就可以,但是由于二进制压缩学的不是很透, ...

  7. unity3d英语单词拼写小游戏Pics Quiz Maker With Categories 3.0

    下载地址: https://item.taobao.com/item.htm?spm=0.7095261.0.0.19f71debcef4hT&id=575991216080

  8. struct和union,enum分析

    空结构体占用的内存多大? struct d { }; int main() { struct d d1; struct d d2; printf("%d,%0x\n",sizeof ...

  9. 并发编程中Future和Callable使用

    Future模式非常适合在处理很耗时很长的业务逻辑时进行使用,可以有效的减少系统的响应时间,提高系统的吞吐量. 看一个小的demo: 看一下执行结果: 这是异步去获取结果的示例,在子线程去处理任务的时 ...

  10. 【Android端】代码打包成jar包/aar形式

    Android端代码打包成jar包和aar形式: 首先,jar包的形式和aar形式有什么区别? 1.打包之后生成的文件地址: *.jar:库/build/intermediates/bundles/d ...