Forum Moderators: phranque

Message Too Old, No Replies

Weird mySQL LOAD DATA INFILE problem

Help... it's driving me loopy!

         

hellacott

9:09 pm on Jun 28, 2005 (gmt 0)



I have a mySQL database that works perfectly. I load data into one of the tables from a flat text file using the LOAD DATA INFILE command. On this system, the text file has about 4,000 rows, separated by \n

I've replicated this structure on the same server, but in a different database. I've used exactly the same SQL command to create the table, and the flat text file is created using exactly the same script the creates the first.

However, when I try to load the text file into the table, only one row is inserted. If I try loading the first text file into the second table, it works perfectly.

This second text file has less rows than the first... only about 500, and is a smaller filesize. The only difference that I can find is that the rows are on average quite a bit longer than in the first text file.

I've hunted around for mention of a bug, but I can't find one... anybody any ideas?

txbakers

10:29 pm on Jun 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi and welcome to the webmaster world!

It could be that your newer data has some special characters in it, causing the file to break earlier.

I had this same problem happen, so now I examine all the data before the LOAD DATA INFILE routine.

I also ONLY use TAB delimited files. No Commas because people use commas in their data.