作者:mobiledu2502923581 | 来源:互联网 | 2017-05-12 14:55
下面有二种超级简单的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的功能哦,那种更方法哦。