参考1:
参考2:
select * from fa.fa_category into outfile "D:/phpstudy_pro/WWW/ccccc.txt" fields terminated by '"' lines terminated by '\r\n';
效果如下:
select * from fa.fa_category into outfile "D:/phpstudy_pro/WWW/ccccc.txt" fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\r\n';
效果如下:
其中语法可参考官网 :MySQL :: MySQL 8.0 Reference Manual :: 13.2.10.1 SELECT ... INTO Statement MySQL :: MySQL 8.0 Reference Manual :: 13.2.7 LOAD DATA Statement