标签:
导入数据: 形式:load data infile ‘路径‘ into table xxx;
outfile:将信息输出到文件上(自动创建文件,不可以重新文件,为了保护文件)
select * from hd_cate;
select * into outfile ‘e:/demo/one‘ from hd_cate;
生成的文件格式;默认的,采用行来区分记录,而采用制表符,来区分字段
为了满足某种特别的需求,会采用不同的分割方式,支持,在导出数据时,设置记录,与字段的分隔符
通过如下的选项
fields:设置字段选项
Lines;设置行选项(记录选项)
(终止) (包裹) (转义)
先看默认的:fields teminated by ‘\t‘ enclosed by ‘‘ escaped by ‘\\‘
记录:lines teminated by ‘\n‘ starting by ‘‘
(终止) (开始)
可以自己设置 例如:
select * into outfile ‘e:/demo/one‘
fields terminated by ‘,‘
lines terminated by ‘\n‘ starting by ‘start:‘
from hd_cate;
注意:常规是用记录,行来显示
但是,保存二进制数据
Blob binary
要用into dumpfile(只在文件末尾加一个文件结束标志)
select * into dumpfile ‘e:/demo/one‘ from hd_cate;
标签:
原文地址:http://www.cnblogs.com/hhfhmf/p/4827597.html