时间:2021-07-01 10:21:17 帮助过:7人阅读
http://www.cnblogs.com/wyzs/p/6762452.html
mysql数据导入导出通过下面的这种方式能够快速的实现百万千万级数据的快速导入导出。
(只能在服务器上操作,当文件存在时操作失败)
1 2 3 4 5 6 7 8 9 10 11 |
SELECT fields INTO OUTFILE ‘file_name‘
[{FIELDS | COLUMNS} 字段
[TERMINATED BY ‘string‘ ] 字段之间分隔符号
[[OPTIONALLY] ENCLOSED BY ‘char‘ ] 字段被包含在char中间
[ESCAPED BY ‘char‘ ] 忽略字段里出现的char
]
[LINES
[STARTING BY ‘string‘ ] 忽略开头是string的行
[TERMINATED BY ‘string‘ ] 行分隔符
]
FROM test_table;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE ‘file_name‘
[REPLACE | IGNORE] 遇到重复的时候处理方法,替换|忽略
INTO TABLE tbl_name 导入数据的目的表名
[PARTITION (partition_name,...)] 分区选择
[CHARACTER SET charset_name] 字符集
[{FIELDS | COLUMNS} 字段
[TERMINATED BY ‘string‘ ] 字段之间分隔符号
[[OPTIONALLY] ENCLOSED BY ‘char‘ ] 字段被包含在char中间
[ESCAPED BY ‘char‘ ] 忽略字段里出现的char
]
[LINES
[STARTING BY ‘string‘ ] 忽略开头是string的行
[TERMINATED BY ‘string‘ ] 行分隔符
]
[IGNORE number {LINES | ROWS}] 忽略行/列
[(col_name_or_user_var,...)] 目的表的表字段名或者用户变量名
[SET col_name = expr ,...] 设置表字段值
|
mysql 导入导出
标签:var cap nat int 导入 忽略 pad order tin