dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: Understanding Checksum Table in MySQL

Learn how to verify if the related files/contents are not tampered with or corrupted.


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


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.

 

Visit the DevX Tip Bank

 





   
Sridhar M S. is a Java developer from Bangalore, India. He holds a master's degree in Computer Science.
Thanks for your registration, follow us on our social networks to keep up-to-date