时间:2021-07-01 10:21:17 帮助过:57人阅读
(我的是windows系统)
LOAD DATA LOCAL INFILE 'C:\\Users\\zl\\Desktop\\zhishu.csv' INTO TABLE 库名.表名 CHARACTER SET gbk FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n'( id, `name`, `description`, parent_id )
注意:
1.csv内文件一般是中文的gbk编码,所以此处设置编码为gbk
2. 括号内是字段名