Where is libmysqlclient?

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?

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

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

Hi Matt,

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

I cannot see this lib from mysql 8 version

[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

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?

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?

@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

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 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
How to correctly use it you can read in our blog: How to Build Percona Server for MySQL From Sources - Percona Database Performance Blog

Hi @Evgeniy_Patlan ,

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

Thanks

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

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

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

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

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

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.

@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

[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

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

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