下面有二种超级简单的mysql命令,可以直接导出csv格式的数据,有需要的朋友可以参考一下,我推荐直接利用phpmyadmin操作,代码如下:
- select * 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'; --Vevb.com
还有一种方法,就是用phpmyadmin的有同学都知道,它带有一个直接导出excel和csv的功能,那种更方便.
新闻热点
疑难解答