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?
Asked
Active
Viewed 241 times
1 Answers
1
No, just
.frmfiles are not enough.However, If you stop your MySQL server and copy everything under
/var/lib/mysql, includingibdata1,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.There are better ways to keep backup or transfer data between servers. See
mysqlhotcopy,mysqldump, etc.
haimg
- 22,193
- 16
- 79
- 113