我要导入CSV文件到MySQL ..类似:导入CSV文件直接到MySQL
load data local infile 'uniq.csv' into table tblUniq
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(uniqName, uniqCity, uniqComments)
http://www.tech-recipes.com/rx/2345/import_csv_file_directly_into_mysql/
但列名的CSV和数据库中的表是不同的我应该怎么办? 我想以编程的方式做。
你将不得不提供更多的信息。例如,CSV文件的前几行是什么?当您运行该查询时,您希望发生什么?反而发生了什么? – cdhowie 2010-11-10 11:27:10