0

Using Mysql 5.7
how to perform online backup using shell script ?
below are conditions :

  1. without stopping MySQL want to perform backup
  2. if any user perform update at the time of backup then what happened ?
3
  • Have a look at this stackoverflow.com/questions/104612/… Commented Dec 11, 2017 at 12:19
  • Yes I saw.. but doubt point is 2. Can u check point 2 Commented Dec 11, 2017 at 12:36
  • I think the shared link is also discussing what are the options to lock or not lock. I think if you want then you can lock the tables and in that case there will be no writes. In other case you have the option to skip locks too. Commented Dec 11, 2017 at 12:38

1 Answer 1

1

Check the --lock-tables, -l option with mysqldump command. I believe you just need to set lock-tables to false and you backup script should work without locking table every time before backup.

As far as your second doubt, I believe that the if any user perform update at the time of backup then that record should not be included in the backup.

Reference: https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_lock-tables

EDIT:

MySql 5.7 also has the concept called HOT BACKUP, though I've never used it before you could try if it works for you. Reference : https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_hot_backup

Sign up to request clarification or add additional context in comments.

6 Comments

Then what happened of that data and next time when run same script again for backup then ?
Any options to check full backup done after check which data updated?
@PramodTiwari Yes, If you want the latest records then you'll have to run the script again. On the other hand, If you don't want to allow user to perform operation while backup is in progress then you need to lock the table during backup.
Locking table impossible...that’s why going to use Online backup. There is concept in ppstgresql WAL archive is it same ?
@PramodTiwari You could create another script which gets updated data after the last backup but that's only possible and run it on any event.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.