In MySQL, the keyword ESCAPED (used as ESCAPED BY) lets you specify a single-byte character that precedes special sequence markers (\n, \t, \0, etc.) when data is imported with LOAD DATA INFILE or exported with SELECT ... INTO OUTFILE. By default, MySQL uses the backslash (\\) as the escape character. Setting ESCAPED BY overrides this default, allowing you to avoid conflicts when the backslash already appears frequently in your data or when you need to turn escaping off entirely (ESCAPED BY '' disables escaping). The chosen character tells MySQL how to interpret subsequent bytes when reading a file and which prefix to write when producing an output file. Only one character is permitted, and it must not be the same as TERMINATED BY or ENCLOSED BY characters. ESCAPED BY applies only to text (not BLOB/BINARY) fields and has no effect on the LIKE ... ESCAPE clause, which is a different SQL feature.
LOAD DATA INFILE, INTO OUTFILE, FIELDS TERMINATED BY, FIELDS ENCLOSED BY, LIKE ... ESCAPE
MySQL 3.23
It sets the single character that precedes special sequences like \n, \t, or \0 when MySQL reads from or writes to a text file with LOAD DATA or INTO OUTFILE.
Use ESCAPED BY '' (empty string). MySQL will then treat every byte literally and will not add escape prefixes to the output file.
No. ESCAPED BY is limited to bulk file I/O, while the LIKE ... ESCAPE clause customizes wildcard escaping in pattern matching.
No. It applies only to text fields. Binary columns are copied byte-for-byte regardless of the escape character.