mysql导入csv

msql导入csv

  load data infile 'D:/1.csv' --CSV文件存放路径
  into table test--要将数据导入的表名
  fields terminated by ',' optionally enclosed by '"' escaped by '"'
  lines terminated by '\r\n';

如果导入的是中文,通常会遇到乱码问题,解决方案如下:

load data local infile 'd:/1.csv' into table test 
character set 'utf8' 
fields terminated by ',';
发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>