Knowledgebase

The sysbench shows the "libmysqlclient.so.18: No such file or directory" error

The error message "libmysqlclient.so.18: No such file or directory" typically indicates that the sysbench tool is trying to dynamically link against a specific version of the MySQL client library, but it cannot find it on your system.

Here's how you can address this issue:

  1. Install the MySQL Client Library:

    If you haven't already, you'll need to install the MySQL client library. The exact package name may vary depending on your Linux distribution:

    • For Ubuntu/Debian:

      bash

 

  • sudo apt-get install libmysqlclient-dev
  • For CentOS/RHEL:

    bash
    • sudo yum install mysql-devel
  • Update Library Cache:

    After installing the library, update the library cache so that the system can find it:

    bash
  • sudo ldconfig
  • Check Library Versions:

    Ensure that the installed MySQL client library version matches the version expected by sysbench. If sysbench is looking for a specific version (e.g., libmysqlclient.so.18), make sure that version is installed.

  • Symlink the Library:

    If the version of libmysqlclient installed on your system is different from what sysbench is expecting, you can create a symbolic link to the existing version. This is a workaround and may not always work perfectly, but it's worth trying:

    bash
  • sudo ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.X /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18

    Replace X with the actual version number of the libmysqlclient library installed on your system.

  • Check LD_LIBRARY_PATH:

    Ensure that your LD_LIBRARY_PATH environment variable includes the directory containing the MySQL client library. For example:

    bash

 

  1. export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
  2. Re-run sysbench:

    After making the necessary adjustments, try running sysbench again.

If none of the above steps resolve the issue, consider checking the sysbench documentation or community forums for any specific recommendations related to your setup. Additionally, verify if there are any specific requirements or configurations for sysbench when working with MySQL.

 
  • 0 Users Found This Useful
Was this answer helpful?