简体   繁体   中英

Checksum of all the database in MySQL innodb

I was looking for a way to get a checksum of the whole current database. I found that : MySQL documentation : CHECKSUM TABLE Syntax . Sounds nearly what I'm looking for, but it is only one table and I would like to execute this on the whole database.

I tryied the following in order to apply to all tables, but it doesn't work (I think it's a wrong usage of CHECKSUM TABLE ).

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

Is there any way to checksum the whole 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM