如何将数据从mysql表复制到.txt文件并返回mysql

select * from member into outfile 'c:/mysql/member.txt';

It is not returning varchar data into the text file. Can I rewrite the data from .txt to mysql table?

I'm not sure what you mean that it's not returning varchar data into the text file. Here is what I recommend:

  1. Explicitly list the columns that you want to export
  2. Explicitly define the termination of fields
  3. Explicitly define the termination of lines

Example:

SELECT id, field_a, field_b...
INTO OUTFILE '/path/to/file'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '
'
FROM table

You will have to adjust the columns according to the table you have and the output of where you want the file to go etc...