MySQL Forums
Forum List  »  Newbie

Re: error 1452 "cannot add or update a child row: foreign key constaint fails"...
Posted by: Bill Karwin
Date: July 21, 2006 10:01AM

I got it to work with:

load data infile 'c:/temp/data.txt'
into table customers
fields terminated by '\t'
optionally enclosed by '"'
lines terminated by '\r\n'

So you may have DOS-style carriage returns in your text file. MySQL defaults to UNIX-style newlines.

Also look for trailing spaces at the end of each line.

Options: ReplyQuote


Subject
Written By
Posted
Re: error 1452 "cannot add or update a child row: foreign key constaint fails"...
July 21, 2006 10:01AM


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.