I accidently imported an empty database backup file into the same database, using mysql-workbench. Is there any way to undo this and get the data back? The backup available is 4 months old which is too old to restore, any ideas?


1 Answer 1


No, you can't. You have overwritten the database so your best course of action is to restore from the latest backup. If that is 4 months old, that's it, you lost 4 months of data.

You should take backups more often and also before any critical operation (like this one) that has the chance of destroying data if it goes wrong.


Before you go and overwrite again the database by restoring the 4-months old backup - and depending on the value of the data you lost - you can take this action:

  • stop the database instance/service, immediately.
  • make sure it doesn't restart (MySQL is often installed with a "watch-dog" that restarts it when it fails).
  • take a complete OS-level backup of the mysql directory or the whole file system, to another, external disk / file-system.

You may be able to find (very expensive) companies/services that may be able to recover some of the data you lost.

It might even be better - if you go the expensive route - to keep this machine (completely shut down or stop all services but not shut down or do whatever these consultants tell you to follow; contact them before you take any severe action) and restore the backup in a separate machine, so you have the best chances of recovering whatever data you can from the existing machine/installation.


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