码迷,mamicode.com
首页 > 数据库 > 详细

MySql导出数据到csv

时间:2016-11-03 18:47:33      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:escape   esc   test   file   shell   nal   closed   nes   tmp   

通过mysql客户端shell连接到服务器,选择使用的数据库,输入sql代码: 

select * from test_info   
into outfile ‘/tmp/test.csv‘   
fields terminated by ‘,‘ optionally enclosed by ‘"‘ escaped by ‘"‘   
lines terminated by ‘\r\n‘;

MySql导出数据到csv

标签:escape   esc   test   file   shell   nal   closed   nes   tmp   

原文地址:http://www.cnblogs.com/SZxiaochun/p/6027450.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!