使用校验命令出现的问题
pt-table-checksum --nocheck-replication-filters --replicate=check_data.checksums --databases=mytest --tables=user --user=slave --password=slave
问题一:
08-06T09:41:00 DBI connect(’;host=localhost;mysql_read_default_group=client’,‘slave’,…) failed: Authentication plugin ‘caching_sha2_password’ cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: 无法打开共享对象文件: 没有那个文件或目录 at /usr/bin/pt-table-checksum line 1623.
解决办法:
首先主从服务连接起来,然后再次新增一个用户,也需要赋予权限,然后再把上面的那个命令 --user --password 改为新增的用户即可解决。
新增用户请看这个文章:https://blog.csdn.net/qq_39408664/article/details/119385299
问题二:
Replica localhost.localdomain has binlog_format ROW which could cause pt-table-checksum to break replication. Please read “Replicas using row-based replication” in the LIMITATIONS section of the tool’s documentation. If you understand the risks, specify --no-check-binlog-format to disable this check
解决办法:
没有加上跳过检查 binlog 日志的指令;--no-check-binlog-format
;改为:
pt-table-checksum --nocheck-replication-filters --no-check-binlog-forma --replicate=check_data.checksums --databases=mytest --tables=user --user=slave --password=slave
问题三:
Replica localhost.localdomain is stopped. Waiting.
Replica localhost.localdomain is stopped. Waiting.
Replica localhost.localdomain is stopped. Waiting.
Replica localhost.localdomain is stopped. Waiting.
Replica localhost.localdomain is stopped. Waiting.
Replica localhost.localdomain is stopped. Waiting.
Replica localhost.localdomain is stopped. Waiting.
Replica localhost.localdomain is stopped. Waiting.
解决办法:
从服务没有连接上,检查一下主库使用的 binlog 文件,从库再执行一次连接即可。
连接方法请看这个文章:https://blog.csdn.net/qq_39408664/article/details/119388103
问题四:
Diffs cannot be detected because no slaves were found. Please read the --recursion-method documentation for information.
解决办法:
- 如果在虚拟机中,需要把防火墙给关掉即可。
- 如果在服务器中,需要添加防火墙的规则即可。