Mysql – Restore MySQL tables with data folder only

disaster recoveryMySQLmysqldump

I have many MySQL databases with many tables and I’m trying to figure out if I can restore all of it only using the content of my MySQL data folder.

Or should I just not bother and use the following instead?

mysqldump --all-databases > db_backup.sql

Best Answer

You cannot move a single table or database around via the filesystem.

If you have the entire folder, then there is a pretty good chance of being able to move (or restore) all databases.

  • ibdata1 must be included
  • Same version of MySQL.
  • directory and file permissions need to be maintained
  • and probably other things.