Compare Table Field Data


I was wondering if anyone knew of a pre-built script or how I would go about doing the following:

I have 1 current mysql table and 1 backup mysql table. The current table has values missing (caused by an angry staff member). I need to somehow restore the missing values from the backup into the current without loosing what have been done since the backup (i.e. additional rows are in the current). Both tables have the same fields it’s just some data has been tampered with in the current table.

Any ideas how I might go about atleast fining the differences between the two, I expect I will have to manually update the changes but if I could something to display that would be atleast a start.


if you know what your looking for open the backup sql file and and copy out the data details and add them to the current version

I was hoping for some kind of script or similar as there is about 20 fields in the table and over 100 records effected, different fields effected etc.


If you look carefully in your mysql logs you might be lucky and find all of the recent sql activity.

This will give you all of the inserts in say the last 24 hours. Your database does not seem too big, so this may not be too onerous a task.

This should allow you to a) restore you backup database, and b) “replay” all of the inserts.

If you are not sure where your logs are being stored then grep the hdd for the file my.ini and take a look in there for where mysql is stuffing things.