Mysql导入csv

登陆 mysql
Mysql导入csv_第1张图片
显示数据库 使用test数据库
Mysql导入csv_第2张图片
新建一张表

CREATE TABLE `it_info` (
  `id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `jobName` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `salary` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `jobType2_code` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `jobType2_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `industry_code` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `city_code` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `city_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `welfare` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `eduLevel` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `workingExp` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `company_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `positionURL` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `JobDetail` text COLLATE utf8_bin,
  `createDate` varchar(255) COLLATE utf8_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

使用命令

load data infile 'D:\IT_beijing.csv'
into table it_guangzhou   character set gb2312
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\r\n';

使用命令查询

SELECT * FROM it_info;

使用navicat观察可视化查询结果
Mysql导入csv_第3张图片

你可能感兴趣的:(mysql)