Example:
Select email from xxxxxx where email is not null and email <> ''into outfile'/mail.txt 'Lines terminated by '\ r \ n ';
Note:
1. Export the file directory:
Modify the directory of the output file name to put it in the specified position. For example, you can change 'a.txt 'to'./a.txt 'or'/a.txt '.
'./A.txt' is stored in the C: \ mysql \ data directory,
The '/a.txt' file is stored in the C: \ directory.
The SELECT command determines that the current directory is the database storage directory.
2. Export data format
Delimiter between fields, escape characters, including characters, and delimiter between record lines. Column:
Fields
Terminated by '\ t'
[Optionally] enclosed''
Escaped '\\'
Lines
Terminated by '\ N'
Terminated indicates that fields are separated.
[Optionally] enclosed indicates the characters used to include a field,
If optionally is used, only char and verchar are included with escaped, which indicates what is used as the escape character when escaping is required.
Lines terminated indicates the number of records separated by lines.