关闭

mysql导入导出csv文件

标签: mysqlcsv
383人阅读 评论(0) 收藏 举报
分类:

mysql导出csv文件

语法块

`select block`
into outfile `/path/of/file`
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\r\n';

例子

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

mysql导入csv文件

语法块

load data infile '/path/of/file'
into table `/name/of/table`
fields terminated by ','  optionally enclosed by '"' escaped by '"'
lines terminated by '\r\n';

例子

load data infile '/tmp/test.csv'
into table test_info
fields terminated by ','  optionally enclosed by '"' escaped by '"'
lines terminated by '\r\n';
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:168471次
    • 积分:2866
    • 等级:
    • 排名:第12824名
    • 原创:124篇
    • 转载:4篇
    • 译文:0篇
    • 评论:0条
    文章分类