I'm using automysqlbackup to backup a a few InnoDB databases, and its working great.
The one problem that I have is that foreign key constraints are being dumped in line with each table definition. This means that when it comes to importing the database from the backup, many constraints will fail (because the related table is not even in existance yet).
The 'normal' way of getting around this is to only run all contraints after all tables have been created. However, I don't see an option for this in automysqlbackup.
Any ideas on the best way around this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-06-17
In case anyone else reads this, the answer is to use the following statement at the top of your import file:
SET FOREIGN_KEY_CHECKS=0;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using automysqlbackup to backup a a few InnoDB databases, and its working great.
The one problem that I have is that foreign key constraints are being dumped in line with each table definition. This means that when it comes to importing the database from the backup, many constraints will fail (because the related table is not even in existance yet).
The 'normal' way of getting around this is to only run all contraints after all tables have been created. However, I don't see an option for this in automysqlbackup.
Any ideas on the best way around this?
In case anyone else reads this, the answer is to use the following statement at the top of your import file:
SET FOREIGN_KEY_CHECKS=0;