# Where is libmysqlclient?

**URL:** <https://forums.percona.com/t/where-is-libmysqlclient/11426>\
**Category:** Percona Server for MySQL 8.0\
**Created:** [July 17, 2021, 1:31pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426 "2021-07-17T13:31:07Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@abh](https://forums.percona.com/u/abh)\
**Post date:** [July 17, 2021, 1:31pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/1 "2021-07-17T13:31:07Z")

</div>

I do compile the Percona 8 like below but cannot find where is libmysqlclient. i can see it in 5.7.

I got issues with Xtrabackup " XtraBackup Complains of Missing perl-DBD-MySQL" and other tool like Zabbix when i compile, it always ask for libmysqlclient

Is this lib include on source package or i need to yum or compile from other souce?

```auto
cmake -Wno-dev -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DFORCE_INSOURCE_BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_unicode_ci -DENABLE_DOWNLOADS=1 -DINSTALL_INCLUDEDIR=/usr/include -DINSTALL_LAYOUT=STANDALONE -DINSTALL_LIBDIR=/usr/lib64/mysql -DINSTALL_PKGCONFIGDIR=/usr/lib64/pkgconfig -DMYSQLX_TCP_PORT=33060 -DMYSQLX_UNIX_ADDR=/tmp/mysqlx.sock -DINSTALL_STATIC_LIBRARIES=ON -DMYSQL_DATADIR=/var/data/mysql -DMYSQL_MAINTAINER_MODE=OFF -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DSYSTEMD_PID_DIR=/var/data/mysql -DSYSTEMD_SERVICE_NAME=mysqld -DTMPDIR=/tmp -DWITH_BOOST=/soft/boost_1_73_0 -DWITH_CURL=system -DWITH_EDITLINE=bundled -DWITH_ICU=bundled -DWITH_INNODB_MEMCACHED=ON -DWITH_LIBEVENT=bundled -DWITH_LZ4=bundled -DWITH_NUMA=ON -DWITH_PROTOBUF=bundled -DWITH_RAPIDJSON=bundled -DWITH_SSL=/usr -DWITH_SYSTEMD=ON -DWITH_ZLIB=system -DWITH_ZSTD=bundled -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_TOKUDB=1 -DWITH_ROCKSDB=1

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [July 19, 2021, 2:59pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/2 "2021-07-19T14:59:16Z")

</div>

Have you tried searching for it? `find /usr/ -name "libmysqlclient*"`

---

<div class="post-metadata">

**Author:** ![abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@abh](https://forums.percona.com/u/abh)\
**Post date:** [July 20, 2021, 1:28am UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/3 "2021-07-20T01:28:24Z")

</div>

Hi Matt,

That is first cli that i tried to find before i post this forum 🙂

I cannot see this lib from mysql 8 version

```auto
[root@localhost ~]# find / -name libmysqlclient*
[root@localhost ~]# mysql -V
mysql Ver 8.0.25-15 for Linux on x86_64 (Source distribution)

```

Just wonder if i install this lib by download rpm package from mysql community then is that compatible with Percona or not?

Thanks

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [July 20, 2021, 3:15am UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/4 "2021-07-20T03:15:25Z")

</div>

Well, you need to decide if you want to compile Percona MySQL 8 and use that, or use our RPMs. Why are you compiling? Also, why would you download mysql community rpm for this library? Why not download the percona library rpm?

---

<div class="post-metadata">

**Author:** ![abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@abh](https://forums.percona.com/u/abh)\
**Post date:** [July 20, 2021, 8:46am UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/5 "2021-07-20T08:46:57Z")

</div>

I want to use Percona server and yes with compile, after compile that i cannot find _libmysqlclient_ so that is a reason why i ask for install this lib by rpm from mysql community version.

Yes, i forget Percona may have this rpm but just wonder why i cannot see this lib after compile or i need to install separately and if i do so then do it conflict to my server?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [July 21, 2021, 3:38am UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/6 "2021-07-21T03:38:45Z")

</div>

@abh I just did a compile and I found the library. I’ll have ask one of the developers why it isn’t named libmysqlclient, but I imagine it is safe to simply create a symlink and then run an ldconfig before linking against it.

/tmp/ps\_8.0.25-15/lib/libperconaserverclient.so.21.1.25  
/tmp/ps\_8.0.25-15/lib/libperconaserverclient.so.21  
/tmp/ps\_8.0.25-15/lib/libperconaserverclient.so

---

<div class="post-metadata">

**Author:** ![Evgeniy\_Patlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/evgeniy_patlan/32/41_2.png) [@Evgeniy\_Patlan](https://forums.percona.com/u/Evgeniy_Patlan)\
**Post date:** [July 21, 2021, 1:04pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/7 "2021-07-21T13:04:31Z")

</div>

Hi @abh.  
Yes we compile libperconaserverclient.so by default.  
In our rpm packages we still provide libmysqlclient.so.  
So if you need to compile by yourself you could apply patch [percona-server/mysql-5.7-sharedlib-rename.patch at 8.0 · percona/percona-server · GitHub](https://github.com/percona/percona-server/blob/8.0/build-ps/rpm/mysql-5.7-sharedlib-rename.patch) and it will compile mysqld linked with libmysqlclient.  
Also we recommend using our build script to compile PerconaServer for MySQL by your own.  
Here it is: [percona-server/percona-server-8.0\_builder.sh at 8.0 · percona/percona-server · GitHub](https://github.com/percona/percona-server/blob/8.0/build-ps/percona-server-8.0_builder.sh)  
How to correctly use it you can read in our blog: [How to Build Percona Server for MySQL From Sources - Percona Database Performance Blog](https://www.percona.com/blog/2021/03/10/how-to-build-percona-server-for-mysql-from-sources/)

---

<div class="post-metadata">

**Author:** ![abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@abh](https://forums.percona.com/u/abh)\
**Post date:** [December 23, 2021, 2:54pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/8 "2021-12-23T14:54:15Z")

</div>

Hi @Evgeniy_Patlan ,

Can you guide me how to “apply patch and it will compile mysqld linked with libmysqlclient.” ?

Thanks

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [December 23, 2021, 3:50pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/9 "2021-12-23T15:50:58Z")

</div>

@abh, download the .patch file that Evgeniy linked above. Use the `patch` utility to apply the patch to your code tree, then compile as usual.

---

<div class="post-metadata">

**Author:** ![abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@abh](https://forums.percona.com/u/abh)\
**Post date:** [December 24, 2021, 2:48am UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/10 "2021-12-24T02:48:41Z")

</div>

Hi @matthewb ,

Pls correct if im wrong

when i run the patch (the patch file i download from the link above)

patch -p0 \< /soft/57.patch

```auto
patching file client/base/CMakeLists.txt
patching file client/CMakeLists.txt
patching file client/migrate_keyring/CMakeLists.txt
patching file include/mysql.h
patching file libmysql/CMakeLists.txt
Hunk #1 FAILED at 276.
Hunk #2 FAILED at 319.
Hunk #3 FAILED at 341.
Hunk #4 succeeded at 364 with fuzz 2 (offset 8 lines).
3 out of 4 hunks FAILED -- saving rejects to file libmysql/CMakeLists.txt.rej
patching file libmysql/libmysql.ver.in
patching file plugin/percona-pam-for-mysql/CMakeLists.txt
patching file plugin/x/tests/driver/CMakeLists.txt
patching file router/src/metadata_cache/CMakeLists.txt
patching file router/src/metadata_cache/tests/CMakeLists.txt
patching file router/src/router/src/CMakeLists.txt
patching file router/tests/fuzzers/CMakeLists.txt
patching file scripts/CMakeLists.txt
patching file storage/ndb/ndbapi-examples/mgmapi_logevent/Makefile
patching file storage/ndb/ndbapi-examples/mgmapi_logevent2/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_async/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_async1/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_blob/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_blob_ndbrecord/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_event/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_recattr_vs_record/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_retries/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_s_i_ndbrecord/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_scan/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_simple/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_simple_dual/Makefile
patching file storage/ndb/ndbapi-examples/ndbapi_simple_index/Makefile
patching file storage/ndb/test/run-test/CMakeLists.txt
patching file storage/ndb/tools/CMakeLists.txt
patching file testclients/CMakeLists.txt
patching file unittest/gunit/group_replication/CMakeLists.txt
patching file unittest/gunit/xplugin/xcl/CMakeLists.txt
patching file unittest/gunit/xplugin/xpl/CMakeLists.txt
patching file storage/tokudb/PerconaFT/tools/CMakeLists.txt
can't find file to patch at input line 544
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- libmysql/authentication_kerberos/CMakeLists.txt 2021-09-28 04:49:14.000000000 +0000
|+++ libmysql/authentication_kerberos/CMakeLists.txt 2021-09-28 09:24:09.917822028 +0000
--------------------------
File to patch:
Skip this patch? [y] y
Skipping patch.
1 out of 1 hunk ignored

```

and then use complie

```auto
cmake -Wno-dev -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DFORCE_INSOURCE_BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_unicode_ci -DENABLE_DOWNLOADS=1 -DINSTALL_INCLUDEDIR=/usr/include -DINSTALL_LAYOUT=STANDALONE -DINSTALL_LIBDIR=/usr/lib64/mysql -DINSTALL_PKGCONFIGDIR=/usr/lib64/pkgconfig -DMYSQLX_TCP_PORT=33060 -DMYSQLX_UNIX_ADDR=/tmp/mysqlx.sock -DMYSQL_DATADIR=/var/data/mysql -DMYSQL_MAINTAINER_MODE=OFF -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DSYSTEMD_PID_DIR=/var/data/mysql -DSYSTEMD_SERVICE_NAME=mysqld -DTMPDIR=/tmp -DWITH_BOOST=/soft/boost_1_73_0 -DWITH_CURL=system -DWITH_EDITLINE=bundled -DWITH_ICU=bundled -DWITH_INNODB_MEMCACHED=ON -DWITH_LIBEVENT=bundled -DWITH_LZ4=bundled -DWITH_NUMA=ON -DWITH_PROTOBUF=bundled -DWITH_RAPIDJSON=bundled -DWITH_SSL=/usr -DWITH_SYSTEMD=ON -DWITH_ZLIB=system -DWITH_ZSTD=bundled -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_TOKUDB=1 -DWITH_ROCKSDB=1

```

after that it show error and it not allow me to gmake

```auto
-- MERGE_CONVENIENCE_LIBRARIES LIBS clientlib;mytime;strings;vio;mysys;zstd
CMake Error at libmysql/CMakeLists.txt:368 (SET_TARGET_PROPERTIES):
  SET_TARGET_PROPERTIES Can not find target to add properties to: mysqlclient

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [December 24, 2021, 4:57pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/11 "2021-12-24T16:57:05Z")

</div>

You had failures applying the patch file. You must make certain that the patch file you downloaded exactly matches the branch/code version you have.

Why don’t you just download the pre-compiled binaries and create a symlink to libmysqlclient? That will instantly solve your issue.

---

<div class="post-metadata">

**Author:** ![abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@abh](https://forums.percona.com/u/abh)\
**Post date:** [December 26, 2021, 1:57pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/12 "2021-12-26T13:57:38Z")

</div>

@matthewb ,

If “yum” direct from Percona then i see the libmysqlclient but im not seeing any libperconaserverclient. It’s bit strange if you ask me

```auto
[root@mail ~]# ls -lh /usr/lib64/mysql/
total 28M
-rw-r--r--. 1 root root 14M Oct 19 19:11 libmysqlclient.a
lrwxrwxrwx. 1 root root 24 Dec 25 11:12 libmysqlclient_r.so.18 -> libmysqlclient.so.18.1.0
lrwxrwxrwx. 1 root root 24 Dec 25 11:12 libmysqlclient_r.so.18.0.0 -> libmysqlclient.so.18.1.0
-rwxr-xr-x. 1 root root 3.5M Oct 19 18:53 libmysqlclient_r.so.18.1.0
lrwxrwxrwx. 1 root root 20 Oct 19 18:53 libmysqlclient.so -> libmysqlclient.so.21
lrwxrwxrwx. 1 root root 26 Dec 25 11:12 libmysqlclient.so.18 -> libmysqlclient_r.so.18.1.0
lrwxrwxrwx. 1 root root 24 Dec 25 11:12 libmysqlclient.so.18.0.0 -> libmysqlclient.so.18.1.0
-rwxr-xr-x. 1 root root 3.5M Oct 19 18:53 libmysqlclient.so.18.1.0
lrwxrwxrwx. 1 root root 25 Oct 19 18:53 libmysqlclient.so.21 -> libmysqlclient.so.21.1.26
-rwxr-xr-x. 1 root root 7.1M Oct 19 19:10 libmysqlclient.so.21.1.26
-rw-r--r--. 1 root root 99K Oct 19 19:11 libmysqlservices.a
drwxr-xr-x. 3 root root 17 Dec 25 11:12 mecab
drwxr-xr-x. 3 root root 4.0K Dec 25 11:12 plugin
drwxr-xr-x. 2 root root 69 Dec 25 11:12 private

```

You are saying “Why don’t you just download the pre-compiled binaries and create a symlink to libmysqlclient”, is that means i still compile as the way i want then download client with rpm version then job done?

Thanks

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [December 27, 2021, 2:40pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/13 "2021-12-27T14:40:56Z")

</div>

> [@abh](#):
>
> i still compile as the way i want

No. “pre-compiled” means that we (Percona) have already compiled it for you and it is ready to work.

---

<div class="post-metadata">

**Author:** ![abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@abh](https://forums.percona.com/u/abh)\
**Post date:** [December 27, 2021, 2:57pm UTC](https://forums.percona.com/t/where-is-libmysqlclient/11426/14 "2021-12-27T14:57:11Z")

</div>

Appreciated your support @matthewb . Im testing performance pre-compile version vs with my manual compile
