LOAD DATA INFILE

Syntax:

LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL]
  INFILE 'filename'
  [REPLACE | IGNORE]
  INTO TABLE table_name
  [FIELDS [TERMINATED BY 'char']
    [[OPTIONALLY] ENCLOSED BY 'char']
    [ESCAPED BY 'char' ]]
  [LINES TERMINATED BY 'char']
  [IGNORE num LINES]
  [(column_list)]

Description: Reads the text file given by filename and imports data into the table given by table_name. Works the same as mysqlimport.

By specifying LOW_PRIORITY, execution waits until no other clients are reading from the table. By specifying CONCURRENT with a MyISAM table, other clients can read from the table while LOAD DATA INFILE is executing.

LOCAL means that a local file on the client, rather than the server, will be used for reading.

The REPLACE and IGNORE ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.