时间:2021-07-01 10:21:17 帮助过:31人阅读
load data infile 'C:\\Users\\Administrator\\Desktop\\import\\CELLutf.csv' into table cell character set gbk(设置gbk字符编码,防止出现中文乱码)
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
IGNORE 1 LINES;
代码解释:
fields terminated by ',':csv文件中数据之间的分隔符,csv文件默认以逗号分隔;
enclosed by '':指出封套符;
lines terminated by '':指行终止符;
IGNORE 1 LINES:忽略csv表头。
以上就是分享csv导入数据到mysql实例的详细内容,更多请关注Gxl网其它相关文章!