MySQL Forums
Forum List  »  Backup

Re: How to Backup/Restore data with foreign keys constraints
Posted by: Benjamin Gonay
Date: February 18, 2005 03:56AM

Hi,

Restoring with foreign key constraints is possible, as explained here http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html

In bash shell (under linux) you can do such things :
echo "SET FOREIGN_KEY_CHECKS=0; source ./${db}-dump-backup.sql; " |mysql -D ${db} 2>>${db}.err 1>&2
in a script , this enable you to see (and keep a trace) of errors during import.
Don't forget to do a CREATE DATABASE ${db} just before.

I can post the full script if you want seeing my method.

Benj

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to Backup/Restore data with foreign keys constraints
14686
February 18, 2005 03:56AM


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.