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. javascript 表格排序和表头浮动效果(扩展SortTable)

    前段时间一个项目有大量页面用到表格排序和表头浮动的效果,在网上找了几个表格排序的js代码,最后选择了 Stuart Langridge的SortTable,在SortTable基础上做了些扩展,加上了 ...

  2. opsmanage 自动化运维管理平台

    关闭防火墙.selinux 更换阿里云 yum源 依赖环境 yum install -y epel-releaseyum install vim net-tools nmon htop rsync t ...

  3. centos 7.3+nginx+jira(.bin)+mysql

    JIRA 安装参考资料 http://www.cnblogs.com/ilanni/p/6200875.html 注意服务启动与关闭 service jira stop service jira st ...

  4. 第二章 向量(e)起泡排序

  5. 33. Search in Rotated Sorted Array (Array;Divide-and-Conquer)

    Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 migh ...

  6. Mac快捷键大全

    Android Studio command+option+L:格式化代码 Visual Studio Code option+shift+f:格式化代码 先按command+k,再按command+ ...

  7. Netty编解码技术

    编解码技术,说白了就是java序列化技术,序列化目的就两个,第一进行网络传输,第二对象持久化. 虽然我们可以使用java进行对象序列化,netty去传输,但是java序列化的硬伤比较多,比如java序 ...

  8. 100-days: Two

    Title: London HIV patient's remission spurs hope for curing AIDS HIV 艾滋病毒  human immunodeficiency vi ...

  9. swift - 解析三方 - ObjectMapper

    // // JYQueryBespeakModel.swift // rtb // // Created by chen on 2018/3/30 // 查询预约信息 import UIKit imp ...

  10. [leetcode]791. Custom Sort String自定义排序字符串

    S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sort ...