[size=xx-large][b][color=brown]Mysql导入数据[/color][/b][/size]
一、介绍
load data [low_priority] [local] infile 'file_name txt' [replace | ignore]
into table tbl_name
[fields
[terminated by't']
[OPTIONALLY] enclosed by '']
[escaped by'\' ]]
[lines terminated by'n']
[ignore number lines]
[(col_name, )]
二、demo:
1.sql.txt
2.语句:
参考:
1.[url]http://www.lsanotes.cn/load-data-local-infile[/url]
2.[url]http://www.58blo.com/?p=163[/url]
3.[url]http://blog.163.com/weiwohappy@126/blog/static/7326333020129300644683/[/url]
一、介绍
load data [low_priority] [local] infile 'file_name txt' [replace | ignore]
into table tbl_name
[fields
[terminated by't']
[OPTIONALLY] enclosed by '']
[escaped by'\' ]]
[lines terminated by'n']
[ignore number lines]
[(col_name, )]
二、demo:
1.sql.txt
11,398875193@qq.com,ewf_momo@foxmail.com,"导入成功",2013-03-09 00:45:01
12,398875193@qq.com,ewf_momo@foxmail.com,"导入成功",2013-03-09 00:45:01
13,398875193@qq.com,ewf_momo@foxmail.com,"导入成功",2013-03-09 00:45:01
14,398875193@qq.com,ewf_momo@foxmail.com,"导入成功",2013-03-09 00:45:01
15,398875193@qq.com,ewf_momo@foxmail.com,"导入成功",2013-03-09 00:45:01
16,398875193@qq.com,ewf_momo@foxmail.com,"导入成功",2013-03-09 00:45:01
2.语句:
LOAD DATA INFILE 'D:\\TestDataDemo\\sql.txt'
INTO TABLE e_mails
FIELDS TERMINATED BY ','
enclosed by '"'
lines terminated by '\r\n'
(id,outbox,inbox,status,send_time);
参考:
1.[url]http://www.lsanotes.cn/load-data-local-infile[/url]
2.[url]http://www.58blo.com/?p=163[/url]
3.[url]http://blog.163.com/weiwohappy@126/blog/static/7326333020129300644683/[/url]