Daniel Kasak wrote:
Greetings.

I've just hit an interesting problem. Luckily I don't actually *need* to restore from a backup right now - I'm just trying to create a database dump to submit an unrelated bug report.

Anyway ...

I'm using the command:

mysqldump -K DATABASE_NAME > db.sql -p

However when I create a new database and try to load the dump file:

mysql NEW_DATABASE < db.sql -p

I get an error when I hit an InnoDB table that has a relationship set up with a table that hasn't yet been created. How do I get around this?


Before loading the file,

  SET FOREIGN_KEY_CHECKS = 0;

after loading the file,

  SET FOREIGN_KEY_CHECKS = 1;


Better yet, edit the dump file to place those as the first line and last lines, respectively. Even better, upgrade to a newer mysql (4.1.1+), where they are automatically added to the dump file for you.

See the manual for more <http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html> (way down at the end).

Michael
Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to