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


Tip of the Day
Language: SQL
Expertise: Intermediate
Jun 28, 2019

WEBINAR:

On-Demand

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


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.

M S Sridhar
 
Thanks for your registration, follow us on our social networks to keep up-to-date