just write the below lines of code to a file in the location where your
mysqldump file exists


SET FOREIGN_KEY_CHECKS = 0;
SOURCE <<dumpfile name>>;
SET FOREIGN_KEY_CHECKS = 1;


then execute the following command

mysql < <<filename>>


Thanks
Anil
DBA



-----Original Message-----
From: Heikki Tuuri [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 22, 2004 8:15 PM
To: mysql@lists.mysql.com
Subject: Re: mysqldump and innodb - set foreign_key_checks=0


Terence,

----- Original Message -----
From: "Terence" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Wednesday, December 22, 2004 5:58 AM
Subject: mysqldump and innodb - set foreign_key_checks=0


> Hi,
>
> After reading the docs I realise that in order to use mysqldump with
> innodb tables i need to include
>
> SET FOREIGN_KEY_CHECKS=0;
>
> at the top of my dump file. Is there anyway to do this when my slave
> starts up or some other way. The dump file is huge and it takes ages to
> open and put the line at the top. (In trying to setup replication I am
> trying all ways to reduce the downtime of the master while I get a
> snapshot onto the slave)
>
> I use
> ./bin/mysql -u root -p < /tmp/dump.sql
> to get the contents into my slave.
>
> Something like this might work:
> ./bin/mysql -u root -p -e "SET FOREIGN_KEY_CHECKS=0;" < /tmp/dump.sql

in 4.1, mysqldump puts that

SET FOREIGN_KEY_CHECKS=0;

automatically to the dump file.

> Grateful for and ideas ...
>
> Thanks

Best regards and Season's Greetings,

Heikki Tuuri
Innobase Oy
Foreign keys, transactions, and row level locking for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM
tables
http://www.innodb.com/order.php

Order MySQL technical support from https://order.mysql.com/


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


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

Reply via email to