List:General Discussion« Previous MessageNext Message »
From:Luciano Barcaro Date:May 4 2004 4:10pm
Subject:Re: InnoDB - Foreign Key - Error 150.
View as plain text  
Gabriel,
First of all, sorry for my poor english (I´m just a brazilian guy - eu 
quase não sei falar o portugues, imaginem o ingles então.)

Tucker, Gabriel wrote:
> Luciano
> 
> I am confused...  As far as I can tell, the set foreign_key_checks=0; is used with
> the load data infile command.  I am not using this command to restore the database.  The
> mysqldump command creates a file with the data and schema.  I restore it to a new instance
> that just has the mysql database using:
>     unix$> mysql --port=port --socket=socket -p < archive.sql

The set foreign_key_checks=0 disables the referential integrity (for 
just one session only).
> 
> So, I am not sure where I would insert this line nor if it would work.  Should I
> insert it in the   "archive.sql" from the previous example?
Yes, you should insert in the beginning of the file, OR
you can do this:

mysql --port=port --socket=socket -p

set foreign_key_checks=0;       -> Disables integrity
\. archive.sql                  -> Execute the script
exit                            -> quits the client

> 
> Can I use the load data infile to restore the file I generated?
As far as I know, no, you can´t.

> 
> Also, in the mysqldump command I used the "--disable-keys" command, believing this
> would correct the problem.  Do you know why it does not?
No, the foreign key error is generated because mysqldump dumps table in 
a different order (alphabetical) that it should.
> 
> I know I asked a bunch of questions, thanks for whatever you can offer!
> 
> Gabe
Thread
InnoDB - Foreign Key - Error 150.Gabriel Tucker4 May
  • Re: InnoDB - Foreign Key - Error 150.Josh Trutwin4 May
RE: InnoDB - Foreign Key - Error 150.Marvin Wright4 May
RE: InnoDB - Foreign Key - Error 150.Gabriel Tucker4 May
  • Re: InnoDB - Foreign Key - Error 150.Victoria Reznichenko4 May
RE: InnoDB - Foreign Key - Error 150.Marvin Wright4 May
  • Re: InnoDB - Foreign Key - Error 150.Ken Menzel4 May
RE: InnoDB - Foreign Key - Error 150.Gabriel Tucker4 May
  • Re: InnoDB - Foreign Key - Error 150.Josh Trutwin4 May
  • Re: InnoDB - Foreign Key - Error 150.Luciano Barcaro4 May
RE: InnoDB - Foreign Key - Error 150.Gabriel Tucker4 May
RE: InnoDB - Foreign Key - Error 150.Gabriel Tucker4 May
  • Re: InnoDB - Foreign Key - Error 150.Victoria Reznichenko5 May
RE: InnoDB - Foreign Key - Error 150.Gabriel Tucker4 May