Understanding Checksum Table in MySQL

CHECKSUM is a concept that is used to verify if the related files/contents are not tampered with or corrupted.

On similar lines, MySQL provides CHECKSUM TABLE to verify the CHECKSUM of a table. You can do this before taking a table backup and after restoring the table to ensure that there is no data loss in the process.

Execute the following, which will yield the CHECKSUM value for the table EMP_DETAILS

CHECKSUM TABLE EMP_DETAILS;

Output:

+-------------+-------------+| TABLE       | Checksum    |+-------------+-------------+| EMP_DETAILS | 491,351,452 |+-------------+-------------+

You can repeat the same command after the table EMP_DETAILS has been restored in a different database or as required.

The values in the Checksum column will indicate a difference if at all, thereby infering that the data in the table EMP_DETAILS has changed.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts