Home >Database >Mysql Tutorial >简单的MySQL中导出CSV的各种方法

简单的MySQL中导出CSV的各种方法

WBOY
WBOYOriginal
2016-06-07 17:51:081081browse

下面有二种超级简单的mysql命令,可以直接导出csv格式的数据,有需要的朋友可以参考一下,我推荐直接利用phpmyadmin操作。

 代码如下 复制代码
* from test_info  
into outfile '/tmp/test.csv'  
fields terminated by ',' optionally enclosed by '"' escaped by '"'  
lines terminated by 'rn';

MySQL中导入CSV格式数据:

 代码如下 复制代码

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


还有一种方法,就是用myadmin的有同学都知道,它带有一个直接导出excel和csv的功能哦,那种更方法哦。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn