1

Need help regarding backup validations for MySQL, what is the best way / easiest way to validate Mysql backups.

we are using mysqldump backup for taking backup's and tar the backup file at the end, could not find any solution on my research.

Any help from this community, Thanks in advance.

  • 1
    What do MySQL backups and Couchbase ones have to do with each other? – Vérace Apr 8 '18 at 14:55
  • @Vérace that was typo i was actually looking for mysql back up validation (updated my question sir) – sreenivas Apr 8 '18 at 16:00
  • 1
    Possible duplicate of this: dba.stackexchange.com/q/60755/94242 – dbdemon Apr 8 '18 at 17:21
  • Agree with below answer that restore is the best way, there is one more work around which is to check tail result file and it should have dump completed line which is written in case of successful backup but it also depends upon your options while taking backup – Nawaz Sohail Apr 9 '18 at 17:34
2

The only way you can validate a backup is to restore that backup; plain and simple. Spin up a VM, install the same version of MySQL from which you took the backup, restore the backup and run some simple tests. If you make this new VM a slave of the original master, configure replication and use pt-table-checksum to validate all data is the same on the slave. At the very least you can use CHECKSUM TABLE <table>; on every table in every database to validate that MySQL is capable of reading every row.

  • Question: if at the end of dump file this line -- Dump completed on 2017-08-15 11:06:17 does that mean the backup was successful? mysqldump exit code 0. – Ivanov Apr 27 '18 at 5:47
  • 1
    Yes, exit code 0 means there were no errors during the dump process. That still does NOT validate your backup is good. The only way to validate a backup is to restore from that backup. If your backup exit code is 0 but when you import there's all kinds of problems, then that backup is no good. – utdrmac Apr 28 '18 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.