LOAD DATA Statement DISABLE KEYS  before loading the file into the table and re-creating the indexes with  ALTER TABLE ... ENABLE KEYS  after loading the file. See Section 8.2.5.1, “Optimizing INSERT Statements” . For both the  LOAD DATA  and  SELECT ... INTO OUTFILE  statements, the syntax of the  FIELDS and  LINES  clauses is the same. Both clauses are optional, but  FIELDS  must precede  LINES  if both are specified. If you specify a  FIELDS  clause, each of its subclauses ( TERMINATED BY ,  [OPTIONALLY] ENCLOSED BY , and  ESCAPED BY ) is also optional, except that you must specify at least one of them. Arguments to these clauses are permitted to contain only ASCII characters. If you specify no  FIELDS  or  LINES  clause, the defaults are the same as if you had written this: FIELDS TERMINATED BY ’	’ ENCLOSED BY ’’ ESCAPED BY ’\\’ LINES TERMINATED BY ’
’ STARTING BY ’’ Backslash is the MySQL escape character within strings in SQL statements. Thus, to specify a literal backslash, you must specify two backslashes for the value to be interpreted as a single backslash. The escape sequences  ’	’  and  ’
’  specify tab and newline characters, respectively. In other words, the defaults cause  LOAD DATA  to act as follows when reading input: Conversely, the defaults cause  SELECT ... INTO OUTFILE  to act as follows when writing output: For a text file generated on a Windows system, proper file reading might require LINES TERMINATED BY ’\r
’  because Windows programs typically use two characters as a line terminator. Some programs, such as  WordPad , might use  \r as a line terminator when writing files. To read such files, use  LINES TERMINATED BY ’\r’ . If all the input lines have a common prefix that you want to ignore, you can use  LINES STARTING BY ’ prefix_string ’  to skip the prefix  and anything before it . If a line does not include the prefix, the entire line is skipped. Suppose that you issue the following statement: LOAD DATA INFILE ’/tmp/test.txt’ INTO TABLE test FIELDS TERMINATED BY ’,’ LINES STARTING BY ’xxx’; 2643 Note Field and Line Handling •Look for line boundaries at newlines. •Do not skip any line prefix. •Break lines into fields at tabs. •Do not expect fields to be enclosed within any quoting characters. •Interpret characters preceded by the escape character  \  as escape sequences. For example,  ,  , and  \\  signify tab, newline, and backslash, respectively. See the discussion of  FIELDS ESCAPED BY later for the full list of escape sequences. •Write tabs between fields. •Do not enclose fields within any quoting characters. •Use  \  to escape instances of tab, newline, or  \  that occur within field values. •Write newlines at the ends of lines.