Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So let's say I copy /var/lib/mysql and save it somewhere else, then uninstall/reinstall MySQL and put the original /var/lib/mysql back where it was. Will I have all of my databases without any trouble?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted
  1. No, just .frm files are not enough.

  2. However, If you stop your MySQL server and copy everything under /var/lib/mysql, including ibdata1, ib_logfile0, ib_logfile1, and everything in subdirectories under /var/lib/mysql (*.frm, *.ibd files), and later on restore these files to some other server, using the same version of MySQL and same configuration (/etc/my.cnf or similar), then you'll be fine.

  3. There are better ways to keep backup or transfer data between servers. See mysqlhotcopy, mysqldump, etc.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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