I am trying to build mysql-shell 1.0.11 from src. RPMs are not an option when I am installing. One of the requirements is libmysqlclient 5.7+. I have installed mysql++, mysql++-devel, mysql-connector-python.noarch, and mysql-workbench-community. When I try to build (Cmake) I get the following error.

Could not find static "libmysqlclient_r.a libmysqlclient.a" in MYSQL_LIB_DIR

What do I need to have installed to make this work? Obviously I need libmysqlclient, but there is nothing listed in yum with that name or close to that name.

Using CentOs7.


  • sudo yum install mysql-devel ; maybe need some repository first. (Google search) Feb 13, 2018 at 13:37

4 Answers 4


yum whatprovides can find package with specific command or lib, for example:

sudo yum whatprovides libmysqlclient*

1:mariadb-libs-5.5.56-2.el7.i686 : The shared libraries required for
                                 : MariaDB/MySQL clients
Repo        : base
Matched from:
Provides    : libmysqlclient.so.18
Provides    : libmysqlclient.so.18(libmysqlclient_16)
Provides    : libmysqlclient.so.18(libmysqlclient_18)


sudo yum install mariadb-libs-5.5.56-2.el7.i686

But I'm not sure it's a good idea to install mysql-shell from src, when you can get with simple yum install mysql


Try yum install mariadb-devel for CentOS 7

  • the only one that worked! thanks
    – zbz.lvlv
    Jun 11, 2021 at 5:34
# find / -name libmysqlclient.so
# ln -s /usr/lib64/mysql/libmysqlclient.so /usr/lib64/libmysqlclient.so
  • 2
    Bijaya, rather than dump a list of commands, it'd be helpful if you explained what you did and why you think it would solve the problem at hand. Thank you!
    – Jeff Schaller
    Sep 10, 2019 at 13:59
# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 

Install packages:

yum install mariadb mariadb-server mariadb-devel mariadb-libs luarocks lua-devel
yum group install "Development Tools"
luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql MYSQL_LIBDIR=/usr/lib64/mysql

And finally got something:

Installing https://luarocks.org/luasql-mysql-2.4.0-1.src.rock...
Using https://luarocks.org/luasql-mysql-2.4.0-1.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/usr/include -c src/luasql.c -o src/luasql.o -I/usr/include/mysql
gcc -O2 -fPIC -I/usr/include -c src/ls_mysql.c -o src/ls_mysql.o -I/usr/include/mysql
gcc -shared -o luasql/mysql.so -L/usr/lib64/lua/5.1 src/luasql.o src/ls_mysql.o -L/usr/lib64/mysql -Wl,-rpath,/usr/lib64/mysql: -lmysqlclient
Updating manifest for /usr/lib64/luarocks/rocks
No existing manifest. Attempting to rebuild...
luasql-mysql 2.4.0-1 is now built and installed in /usr (license: MIT/X11)


# luarocks list
Installed rocks:
   2.4.0-1 (installed) - /usr/lib64/luarocks/rocks
  • 1
    I see that you've compiled a mysql package of some sort and linked it against a mysqlclient library, but you aren't showing how to install libmysqlclient to begin with, which is what this OP is asking about...
    – Jeff Schaller
    Jun 13, 2019 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.