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:
> 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!