1:将数据导出生成txt

mysql>select name from user into outfile 't.txt';

t.txt即是你要查询的数据文件,在mysql的安装目录下,你可以使用find . -name 't.txt',全局查询一下即可

2:批量导入文本数据的mysql命令:
mysql> use dbname;
mysql> load data local infile "/data/mobile.txt" into table tbname fields terminated by '\t' lines terminated by '\r\n';

命令说明:
mysql> load data local infile "要导入的文本文件" into table 表名 fields terminated by '\t' lines terminated by '\r\n';
其中fields terminated by 表示字段分隔符
lines terminated by 表示行分隔符(就是行与行之间的分隔符)