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. 牛客网练习赛44-B(快速幂+模拟)

    题目链接:https://ac.nowcoder.com/acm/contest/548/B 题意:计算m/n小数点后k1位到k2位,1≤m≤n≤109,1<=k1<=k2<=109 ...

  2. 解决 HDFS 开发 java.lang.IllegalArgumentException: java.net.UnknownHostException: hadoop000

    出现这种问题多半是windows找不到linux主机所以在 这个路径下的hosts加上linux ip地址,主机名就可以了

  3. Git之清除已保存的账户

    Git会自动保存输入过的用户名.密码. Git的配置文件是-/.gitconfig.可在windows下的GIt Bash.Mac的命令行中,用vim ~/.gitconfig打开. Windows ...

  4. mysql学习2:模糊匹配查询like,regexp,in

    mysql模糊匹配查询like,regexp,in   摘要 内容比较简单,无摘要.   关键词 模糊查询  like  regexp  in  contact   正文 下图是示例用到的数据表信息 ...

  5. 使用python语言计算n的阶乘

    计算“1x2x3x4” def factorial(n): result = n ,n): result *= i return resultdef main(): print factorial(4 ...

  6. Java01-Java基本概念及JDK安装

    Java是由sun公司于1995年5月推出的Java程序设计语言和Java平台的总称. Java是一个完整的平台,不仅提供了优秀的编程语言,而且还提供了大量的可重用代码以及一个能提供安全性.可移植性. ...

  7. HTML基础学习笔记(1)

    HTML学习笔记(1) 1.常用快捷键 win+d---返回桌面 win+e---我的电脑 win+r---打开运行 Alt+tab---切换软件 ctrl+tab---切换软件文档 F2---重命名 ...

  8. Android camera2 回调imagereader 从Image拿到YUV数据转化成RGB,生成bitmap并保存

    ImageUtil.java import android.graphics.ImageFormat; import android.media.Image; import android.os.Bu ...

  9. Windows系统崩溃后快速恢复Oracle数据库的妙招

    Windows系统崩溃后快速恢复Oracle数据库,以下是操作步骤 假设oracle数据安装在d:\\oracle文件夹中,数据库名称orcl 1>将崩溃的数据库安装目录"d:\\or ...

  10. migrantion

    Enable-Migrations - ConfigurationTypeName namespace.DbContext Enable-Migrations命令创建了一个新的Migrations文件 ...