在您的情况下,转义字符应该只是“\”,因为您正在使用 \ 来转义字符。它不是要求您要转义的序列列表,只是让它知道它正在被转义的字符,在这种情况下是 \。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 使用 MySQL 5.0.21
mysql> select ID,MSISDN,IFNULL(TITLE,''),IFNULL(SECONDARY_TITLE,''),IFNULL(NAME,''),IFNULL(ACTIVATION_DATE,''),IFNULL(CREDIT_EXPIRY_DATE,''),
-> IFNULL(FIRST_VOICE_CALL_DATE,'') ,IFNULL(FIRST_SMS_DATE,''),IFNULL(FIRST_MMS_DATE,''),IFNULL(FIRST_WAP_DATE,''),
-> IFNULL(FIRST_TOPUP_DATE,''),IFNULL(TOTAL_USAGE,''),IFNULL(TOTAL_TOPUP_AMOUNT,''),IFNULL(TOTAL_TOPUP_COUNT,''),
-> IFNULL(LAST_TOPUP_DATE,''),IFNULL(ACCOUNT_BALANCE,''),IFNULL(TARIFF_PLAN,''), IFNULL(DATE_OF_BIRTH,''),IFNULL(ADDRESS,''),
-> IFNULL(COUNTRY,''),IFNULL(CITY,''),IFNULL(POSTCODE,''),IFNULL(IC_NUMBER,''), GENDER,IFNULL(FIXED_LINE_PHONE,''),IFNULL(EMAIL,''),
-> IFNULL(PROFESSION,''),IFNULL(EMPLOYER_NAME,''),IFNULL(EMPLOYER_ADDRESS,''), IFNULL(EMPLOYER_PHONE_NUMBER,''),
-> IFNULL(EMPLOYER_FAX_NUMBER,''),IFNULL(SIM_STATE,''),IFNULL(ADDITIONAL_INFORMATION,'') INTO OUTFILE '/tmp/SUBSCRIBER_PROFILE.txt'
-> ***FIELDS ESCAPED BY '\",\\r,\\015\n,\\n,\\b'*** TERMINATED BY '|' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' FROM SUBSCRIBER_PROFILE;
*Query OK, 345812 rows affected (7.77 sec*)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 不适用于 MySQL 5.5.28
mysql> select ID,MSISDN,IFNULL(TITLE,''),IFNULL(SECONDARY_TITLE,''),IFNULL(NAME,''),IFNULL(ACTIVATION_DATE,''),IFNULL(CREDIT_EXPIRY_DATE,''),
-> IFNULL(FIRST_VOICE_CALL_DATE,'') ,IFNULL(FIRST_SMS_DATE,''),IFNULL(FIRST_MMS_DATE,''),IFNULL(FIRST_WAP_DATE,''),
-> IFNULL(FIRST_TOPUP_DATE,''),IFNULL(TOTAL_USAGE,''),IFNULL(TOTAL_TOPUP_AMOUNT,''),IFNULL(TOTAL_TOPUP_COUNT,''),
-> IFNULL(LAST_TOPUP_DATE,''),IFNULL(ACCOUNT_BALANCE,''),IFNULL(TARIFF_PLAN,''),IFNULL(DATE_OF_BIRTH,''),IFNULL(ADDRESS,''),
-> IFNULL(COUNTRY,''),IFNULL(CITY,''),IFNULL(POSTCODE,''),IFNULL(IC_NUMBER,''),GENDER,IFNULL(FIXED_LINE_PHONE,''),IFNULL(EMAIL,''),
-> IFNULL(PROFESSION,''),IFNULL(EMPLOYER_NAME,''),IFNULL(EMPLOYER_ADDRESS,''),IFNULL(EMPLOYER_PHONE_NUMBER,''),
-> IFNULL(EMPLOYER_FAX_NUMBER,''),IFNULL(SIM_STATE,''),IFNULL(ADDITIONAL_INFORMATION,'') INTO OUTFILE '/tmp/SUBSCRIBER_PROFILE.txt'
-> **FIELDS ESCAPED BY '\",\\r,\\015\n,\\n,\\b'** TERMINATED BY '|' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' FROM SUBSCRIBER_PROFILE;
*ERROR 1083 (42000): Field separator argument is not what is expected; check the manual*