MySql 文件导入导出

1、将表输出到文件

select * FROM zhilianzhaopin4

INTO OUTFILE 'G:/test.csv'      --------输出位置

fields terminated by '@@'        --------字段用@@分割

optionally enclosed by '"'  ------字段用"号括起(单引号包一个双引号)

escaped by '"'         ------字段中使用的转义符为"

lines terminated by ' ';  ------行以 结束

2、将表导入到数据库

二、csv文件导入

load data infile '/tmp/test.csv'   

into table test_info    

fields terminated by ','  

optionally enclosed by '"' 

escaped by '"'   

lines terminated by ' '; 

参考http://www.cnblogs.com/SZxiaochun/p/6027450.html

原文地址:https://www.cnblogs.com/zhangguangxiang/p/14232628.html