1

How to tell whether mysql was built with libedit or readline?

I'm trying to configure the mysql client tool to use Ctrl-R for searching command history but not sure which input library my installation is using.

2

If on Linux you can just use ldd to check which libraries it's dynamically linked against:

phil@ironforge:~$  ldd `which mysql`
        linux-vdso.so.1 =>  (0x00007ffd5add5000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007eff0a44e000)
        libreadline.so.5 => /lib/x86_64-linux-gnu/libreadline.so.5 (0x00007eff0a210000)
        libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007eff09fee000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007eff09dc4000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007eff09baa000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007eff099a6000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007eff09623000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007eff0931a000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007eff08f50000)
        /lib64/ld-linux-x86-64.so.2 (0x000055960d9f2000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007eff08d39000)
phil@ironforge:~$

In this example on my host, it's linked against libreadline.

It's also in the --help output:

phil@ironforge:~$ mysql --help | grep readline
mysql  Ver 15.1 Distrib 10.0.36-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
phil@ironforge:~$ 
  • This works, though I had to use otool -L $(which mysql) instead of ldd because my macos didn't have ldd (or I haven't found it yet). – DC Slagel May 12 at 12:23

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.