2000W CSV数据导入mysql

创建表:

CREATE TABLE `kfinfo` (   
  `Name` varchar(100) DEFAULT NULL,   
  `CardNo` varchar(50) DEFAULT NULL,   
  `Descriot` varchar(150) DEFAULT NULL,   
  `CtfTp` varchar(50) DEFAULT NULL,   
  `CtfId` varchar(50) DEFAULT NULL,   
  `Gender` varchar(50) DEFAULT NULL,   
  `Birthday` varchar(50) DEFAULT NULL,   
  `Address` varchar(200) DEFAULT NULL,   
  `Zip` varchar(50) DEFAULT NULL,   
  `Dirty` varchar(50) DEFAULT NULL,   
  `District1` varchar(50) DEFAULT NULL,   
  `District2` varchar(50) DEFAULT NULL,   
  `District3` varchar(50) DEFAULT NULL,   
  `District4` varchar(50) DEFAULT NULL,   
  `District5` varchar(50) DEFAULT NULL,   
  `District6` varchar(50) DEFAULT NULL,   
  `FirstNm` varchar(50) DEFAULT NULL,   
  `LastNm` varchar(50) DEFAULT NULL,   
  `Duty` varchar(50) DEFAULT NULL,   
  `Mobile` varchar(50) DEFAULT NULL,   
  `Tel` varchar(50) DEFAULT NULL,   
  `Fax` varchar(50) DEFAULT NULL,   
  `EMail` varchar(50) DEFAULT NULL,   
  `Nation` varchar(50) DEFAULT NULL,   
  `Taste` varchar(150) DEFAULT NULL,   
  `Education` varchar(50) DEFAULT NULL,   
  `Company` varchar(50) DEFAULT NULL,   
  `CTel` varchar(50) DEFAULT NULL,   
  `CAddress` varchar(50) DEFAULT NULL,   
  `CZip` varchar(50) DEFAULT NULL,   
  `Family` varchar(50) DEFAULT NULL,   
  `Version` varchar(50) DEFAULT NULL,   
  `id` varchar(50) NOT NULL DEFAULT '',   
  PRIMARY KEY (`id`)   
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

windows下进入DOS界面,

#cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin

#mysql -u root -p(进入命令模式)

#输入密码

#use luc(选择数据库)

#LOAD DATA INFILE 'E:\\2000W\\1-200W.csv' INTO TABLE kfinfo FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '' LINES TERMINATED BY '\r\n' ignore 1 lines;

相关推荐