Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-07 17:51:08
Original
1048 people have browsed it

下面有二种超级简单的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的功能哦,那种更方法哦。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!