MySQL .csv load failing due to “Cannot add or update a child row: foreign key constraint fails”
问题 I'm trying to load a .csv file with baseball schedules into a table of games. The csv file contents look like this: 5/17/2011,8:10 PM,14,13,Kansas City,MO 5/18/2011,8:10 PM,14,16,Chicago,IL 5/19/2011,8:10 PM,14,16,Chicago,IL 5/20/2011,7:05 PM,26,14,Columbus,OH and my sql statement to try and insert them is: LOAD DATA LOCAL INFILE 'c:/ftpsite/comp.csv' INTO TABLE game FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' (@DATE_STR, time, awayteam_id, hometeam_id,locationcity