Excel文件导入Mysql

  • 将excel另存为csv文件
  • 新建一张表,字段数量和csv字段数量一致
  • 写sql
LOAD DATA LOCAL INFILE 'C:\\Users\\chenph\\Desktop\\1.csv'
INTO TABLE test.b CHARACTER SET gbk 
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"'
LINES TERMINATED BY '\r\n'(
a,b,c,d
)
  • 完成。
  • 原文地址:http://blog.csdn.net/yueritian/article/details/49589991

你可能感兴趣的:(mysql,Excel,导入)