下面有二種超級簡單的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';
還有一種方法,就是用PHPmyadmin的有同學都知道,它帶有一個直接導出Excel和csv的功能哦,那種更方法哦。