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. Unity5权威讲解+项目源码+MP4

    扫码时备注或说明中留下邮箱 付款后如未回复请至https://shop135452397.taobao.com/ 联系店主

  2. Python: re.sub()第二个参数

    起源: 问题源于解析kissanime.io这个网站.为反扒抑或是防止ddos攻击,此视频页面,初进去会有个5秒延迟并提交一表单验证.而其表单验证,为下面一段html代码: <form id=& ...

  3. C# 创建WebService的简单示例

    工具Visual Studio 2013 1.创建一个空的Web应用程序. 2.鼠标右击项目,添加->新建项 选择Web服务(ASMX),点击添加.一个简单的webservice就创建完成了.

  4. centos7下apache2.4反向代理

    apache安装目录在/data/apache24,这里就不介绍apache的安装了. 一.反向代理配置 在/data/apache24/conf/extra下创建htttpd-proxy.conf文 ...

  5. 瑞波Ripple-OnlineDeletion配置的理解

    1.概要 如果没有设置online deletion,那么Rippled Server的本地数据库大小将会无限增长.为了释放磁盘空间,那种情况应该被制止并且那些数据库文件应该被手动删除.online ...

  6. ABP框架使用Mysql数据库

    参考文档:https://github.com/ABPFrameWorkGroup/AbpDocument2Chinese/blob/master/Markdown/Abp/9.4ABP%E5%9F% ...

  7. Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this

    最近使用新版本的mysql,执行语句的时候报错.网上找了一下,解决方法如下: vim /etc/mysql/conf.d/mysql.cnf [mysqld] sql_mode=STRICT_TRAN ...

  8. 20.Mysql锁机制

    20.锁问题锁是计算机协调多个进程或线程并发访问某一资源的机制. 20.1 Mysql锁概述锁类型分为表级锁.页面锁.行级锁.表级锁:一个线程对表进行DML时会锁住整张表,其它线程只能读该表,如果要写 ...

  9. Linux_(1)基本命令(上)

    一.基本命令1.我是谁 whoami --who am i2.谁在线 who w3.显示当前路径(定位) pwd4.切换目录 cd ~返回主目录 cd ..返回上一级目录5.查看某个目录中的子目录和文 ...

  10. springboot中controller的使用

    一.知识点 1 @Controller 处理http请求(不推荐使用) 2 @RestController spring4之后新加的注解,原来返回json需要@ResponseBody配合@Contr ...