导出mysql中数据到csv中

 

通过 mysql -e 的方式导出数据.

mysql -uuser -ppwd -hxxxx.aliyuncs.com -P3306  db1 -e "select distinct concat(t.sign,','),concat(s.nick,',') from ma m left outer join template t on m.tpl_id=t.tpl_id left outer join shop_info s on t.shop_uid=s.sid where m.send_mode=1 and send_time between '2015-06-01' and '2015-06-30 23:59:59' limit 50;">xx.csv

 

然后对文件编码用文本编辑器修改下,修改成gbk的样式.

 

你可能感兴趣的:(mysql)