Mysql – ESCAPED BY clause in LOAD DATA INFILE

loadMySQLmysql-5.5

Can somebody please help me understand what is ESCAPED BY clause means in LOAD DATA LOCAL INFILE statement MySQL 5.5. I am a newbie to MySQL so please bear with me.

Best Answer

Generally the defaults cause LOAD DATA INFILE to act as follows when reading input:

Look for line boundaries at newlines.
Break lines into fields at tabs.
Do not expect fields to be enclosed within any quoting characters.
Interpret occurrences of tab, newline, or \' preceded by\' as literal characters that are part of field values.
Conversely, the defaults cause SELECT ... INTO OUTFILE to act as follows when writing output:

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.

Note that to write FIELDS ESCAPED BY '\\', you must specify two backslashes for the value to be read as a single backslash.

For Further Details Please Have a Look at following Link :- dev.mysql.com/doc/refman/5.1/en/load-data.html