mysql提供了包文件中的数据插入到表中;
LOADDA
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY '\t']
[OPTIONALLY] ENCLOSED BY '']
[ESCAPED BY '\\' ]]
[LINES TERMINATED BY '\n']
[IGNORE number LINES]
[(col_name,...)]
待插入数据:
sql 语句:
load data infile 'lzp.txt' intotable test fields terminated by ',' lines terminated by '/';
结果: