Home > database >  Mysql history data recovery
Mysql history data recovery

Time:10-01

Current status:
Environment: is a multi-user operating a system at the same time, the following to the student management system, for example
New action: A new student information, A version of 01, specific content distribution more list in the db table are student id as the primary key, only A history list will record version changes,
Revision: the corresponding changed A table in the student's home address, the update operation, the address 1 to 2, A corresponding file version to 02, history will instead of A record in the table A - 01 into two records A - 01 and A - 02,
Requirements: can make information from version 02 A restore to the version 01,

Because is take over the project, initially to people just list the version history of design, no thinking can return the whole document to a particular version of before, so the project code in the database of the corresponding increase deletion operation has been written, now modify the code unrealistic large area, it wouldn't be allowed to,

Above is just an example, so there is only one update statement, practice, there will be a lot of different tables to modify, delete, new action, such as

Would like to ask you what is a good way to solve this situation?

Thank you,

CodePudding user response:

Didn't see
If you say, is refers to the overall return to a certain point in time, then use the database backup + recovery implementation
If your recovery, is simply the certainty of recovery, such as your students, for example, data recovery, only to recover the student information and related tables to certain versions of history, but not related to table is, that you can only write code realization, because the correlation is for certain, recovery of demand and the specific processing also is for sure, only through specific implementation code according to the recovery needs to do
  • Related