如何使用文件加载查询?
我尝试了这个查询:
LOAD DATA INFILE 'customer.csv' INTO TABLE customer
答案 0 :(得分:2)
Syntax:
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' INTO TABLE `tbl_name` CHARACTER SET [CHARACTER SET charset_name] FIELDS [{FIELDS | COLUMNS}[TERMINATED BY 'string']] [LINES[TERMINATED BY 'string']]
Example:
LOAD DATA LOCAL INFILE 'E:\\wamp\\tmp\\customer.csv' INTO TABLE `customer` CHARACTER SET 'utf8' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'