阿亮 2020-05-26
SELECT * FROM logdb.tmp_mongodb_rows LIMIT 100 /*导出文件位置*/ INTO OUTFILE ‘/backup/csvdir/test.csv‘ /*字段间以,号分隔*/ FIELDS TERMINATED BY ‘,‘ /*字符串字段用"号括起*/ OPTIONALLY ENCLOSED BY ‘"‘ /*字段中使用的转义符为"*/ ESCAPED BY ‘"‘ /*行以\r\n结束*/ LINES TERMINATED BY ‘\r\n‘;
mysql导入cs文件到 logdb.tmp_mongodb_rows表
load data infile?‘/backup/csvdir//test.csv‘ /*REPLACE:新行将代替有相同的唯一键值的现有行 IGNORE:跳过有唯一键的现有行的重复行的输入*/ REPLACE /*要插入的表*/ into table logdb.tmp_mongodb_rows /*字段间以,号分隔*/ fields?terminated?by?‘,‘? /*字符串字段用"号括起*/ optionally?enclosed?by?‘"‘? /*字段中使用的转义符为"*/ escaped?by?‘"‘? /*行以\r\n结束*/ lines?terminated?by?‘\r\n‘;