gpt4 book ai didi

mysql - MySQL innodb 中所有数据库的校验和

转载 作者:行者123 更新时间:2023-11-29 22:09:37 25 4
gpt4 key购买 nike

我正在寻找一种方法来获取整个当前数据库的校验和。我发现:MySQL documentation : CHECKSUM TABLE Syntax 。听起来几乎就是我正在寻找的,但它只是一个表,我想在整个数据库上执行它。

我尝试了以下方法以应用于所有表,但它不起作用(我认为这是 CHECKSUM TABLE 的错误用法)。

CHECKSUM TABLE (
SELECT table_name FROM information_schema.tables
WHERE table_schema = database()
);

有没有办法对整个数据库进行校验和?

最佳答案

https://www.percona.com/doc/percona-toolkit/2.0/pt-table-checksum.html --

pt-table-checksum performs an online replication consistency check by executing checksum queries on the master, which produces different results on replicas that are inconsistent with the master. The optional DSN specifies the master host. The tool’s exit status is nonzero if any differences are found, or if any warnings or errors occur.

The following command will connect to the replication master on localhost, checksum every table, and report the results on every detected replica

关于mysql - MySQL innodb 中所有数据库的校验和,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31810006/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com