一、自动输出中文字符集
select * from db into outfile ‘test.csv‘ CHARACTER SET gbk fields terminated by ‘,‘ optionally enclosed by ‘"‘ escaped by ‘"‘ lines terminated by ‘\r\n‘;
二、导出后转换字符集
转换成CSV文件,如果乱码将CSV已记事本打开另存为UTF8
select * from db into outfile ‘test.csv‘ fields terminated by ‘,‘ optionally enclosed by ‘‘ lines terminated by ‘\n‘;
时间: 2024-10-13 02:33:24