Find the location of libmysqlclient.so.X file in Linux environments

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).

时间: 2024-10-10 15:47:09

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

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 message.log or Display the lines between 1000 and 1020 from file message.log Solution: Using sed: sed -n '1000,1020p' message.log sed -n '1000,1020p;

Simple way to display the path of object file in linux terminal

There are two ways to check the path of object file, here you are: >find / -name filename.后缀 >locate filename.后缀 the above command will display the result list of filepath.

How to Change Default Location for Outlook Data File (PST & OST)

Is there a way to change the default location of new .pst file when create a new e-mail account in Outlook? Different versions of Outlook use different default locations to store pst files. In this tutorial we'll show you how to change default locati

The Portable Executable File Format from Top to Bottom(每个结构体都非常清楚)

The Portable Executable File Format from Top to Bottom Randy KathMicrosoft Developer Network Technology Group Created: June 12, 1993 Click to open or copy the files in the EXEVIEW sample application for this technical article. Click to open or copy t

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

使用shell脚本实现对Oracle数据库的监控与管理将大大简化DBA的工作负担,如常见的对实例的监控,监听的监控,告警日志的监控,以及数据库的备份,AWR report的自动邮件等.本文给出Linux 下使用 shell 脚本来监控 Oracle 告警日志(monitor alter log file). Linux Shell的相关参考:        Linux/Unix shell 脚本中调用SQL,RMAN脚本        Linux/Unix shell sql 之间传递变量   

修改Database File

使用Alter Database 能够Add,Modify,Remove 数据库的Data File 和Log File. ALTER DATABASE database_name { <add_or_modify_files> } [;] <add_or_modify_files>::= { ADD FILE <filespec> [ ,...n ] [ TO FILEGROUP { filegroup_name } ] | ADD LOG FILE <file

File System Design Case Studies

SRC=http://www.cs.rutgers.edu/~pxk/416/notes/13-fs-studies.html Paul Krzyzanowski April 24, 2014 Introduction We've studied various approaches to file system design. Now we'll look at some real file systems to explore the approaches that were taken i

linux c语言 rename的用法-rename() does not work across different mount points, even if the same file system is mounted on both

最近在一个项目上执行文件的搬移功能时发现总是失败,临时录像文件存放于emmc的/tmp/目录下,当录像完成时候则调用rename企图将此文件搬到/mnt/sdcard/mmcblk1p1/(这是外置的sd卡)上面,但是每次执行rename的时候都返回失败了. man 2  rename解释如下: 1 RENAME(2) Linux Programmer's Manual RENAME(2) 2 3 NAME 4 rename - change the name or location of a

Creating a PXE Configuration File

  The PXE configuration file defines the menu displayed to the pxe client host as it boots up and contacts the TFTP server. You need a PXE configuration file for PXE. The TFTP server is always listening for PXE clients on the network. When it detects