my OS died today, so I have to copy the data onto working machine. I've set up the new environment including MySQL, then copied contents of /var/lib/mysql from an old machine to the new one. Unfortunately, while looking at the results I have noticed that some (yes, only some) databases are completely empty - while the others survived untouched. The only thing connecting those databases with "lost" tables and records, is the fact they were all created recently, comparing to the survived ones. [by recently I mean half a year or so]

My question is quite obvious now - how should I restore the data correctly?

Thanks in advance

  • How did perform your backups? Without knowing how you performed your backups telling you how to restore, or even if you can restore is pretty difficult. If you just copying the files without from /var/lib/mysql you may have lost your data. – Zoredache Aug 10 '10 at 17:50
  1. What is your Data Storage Engine (MyISAM, InnoDB)?
  2. How did you perform the backup/restore (scp, cp, tar, rsync ?)
  3. Was fsck run on your old system ? did it notice any issues ?
  4. did you try using mysqldump from the old box ?
  5. Was your OS and data on same partition ?
  6. if you are able to mount the MySQL data partition from the old machine, and have a new instance of MySQL use it, then you could run a mysqlcheck and then do the necessary ?

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.