restore from mysqldump --all-databases fails with "cannot add foreign key constraint"
Posted by: Didier Wiroth
Date: March 14, 2013 04:06AM

Hello,

I'm testing my backup & restore strategy and actually really glad I did ...

I'm using mysqldumP to backup all our databases:
mysqldump -u root --all-databases > full.sql

And when I try to restore a single database from within the full dump file:
mysql -D bts -o -u root < full.sql
ERROR 1215 (HY000) at line 58: Cannot add foreign key constraint

And this is true for every DB in the file
mysql -D rde -o -u root < full.sql
ERROR 1215 (HY000) at line 2571: Cannot add foreign key constraint
etc

The restoring fails for every DB in the file with foreign key problems.

If I use mysqldump to backup a single DB and restore them from a file containing only one db, restoration is possible without any errors.

The Server I'm doing the dump is:
Server version 5.5.28-log
Protocol version 10

I'm trying to restore the dump on a server 5.5.30 or 5.6.30 ... no luck so far.

Do I miss something here?

Thanks a lot!!!
Didier

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.