Rate This Document
Findability
Accuracy
Completeness
Readability

Failed to Run the pt-table-checksum Command When Checking Whether the Primary and Secondary Databases Are Consistent

Symptom

The pt-table-checksum command fails to be executed to check whether the primary and secondary databases are consistent.

Key Process and Cause Analysis

  1. Query the location of mysql.so.
    locate mysql.so

  2. Query the dynamic link libraries (DLLs) of mysql.so.
    ldd /usr/lib64/perl5/vendor_perl/auto/DBD/mysql/mysql.so

    The following query result indicates that the DLL of libmysqlclient.so.18 is missing.

Conclusion and Solution

  1. Query the location of libmysqlclient.so.18.
    locate libmysqlclient.so.18
    ls /usr/lib64/mysql/libmysqlclient.so*

  2. Query the soft link status of libmysqlclient.so.18.
    ll /usr/lib64/mysql/libmysqlclient.so.18

  3. Copy library files.
    cp /usr/lib64/mysql/libmysqlclient.so* /usr/local/mysql/lib
    ls /usr/local/mysql/lib | grep libmysqlclient.so.18
    ll /usr/local/mysql/lib/libmysqlclient.so.18

  4. Add the DLL of libmysqlclient.so.18.
    echo '/usr/local/mysql/lib' >> /etc/ld.so.conf.d/mysql.conf
    ldconfig
    ldconfig -p | grep libmysqlclient.so.18

  5. Query the DLLs of mysql.so.
    ldd /usr/lib64/perl5/vendor_perl/auto/DBD/mysql/mysql.so

  6. Run the pt-table-checksum command again.
    pt-table-checksum