1:导出的SQL命令,只需要加上“FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY ' ' ”
select a.contact, a.text, b.nickname, b.create_time into outfile '/tmp/4.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY ' ' from feedback a, user_3 b where a.text like '%XXX+%' and a.user_id = b.id and b.create_time >= '2016-03-28 00:00:00' and b.create_time < '2016-03-29 00:00:00';
2:导出后的CSV打开是乱码,解决乱码问题
3:用notepad打开,在格式里面选择utf8格式编码,保存。再打开就是正常了