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
- Query the location of mysql.so.
locate mysql.so

- 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
- Query the location of libmysqlclient.so.18.
locate libmysqlclient.so.18 ls /usr/lib64/mysql/libmysqlclient.so*

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

- 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

- 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

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

- Run the pt-table-checksum command again.
pt-table-checksum
Parent topic: Troubleshooting