Home > Back-end >  Mysql import CSV data in a table, but the data format is wrong
Mysql import CSV data in a table, but the data format is wrong

Time:09-21

I put the CSV data to SQL, but the original CSV table are of digital type, in my table is actually a digital model, even if I set is varchar, solving

Use o2o_stage1_lucky;
The create table stage1_train_off (
User_id varchar (32),
Merchant_id varchar (32),
Coupon_id varchar (32),
Discount_rate varchar (32),
Short varchar (32),
Date_received varchar (32),
Date_id varchar (32)
);

The load data infile 'C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/ccf_offline_stage1_train CSV'
Into the table o2o_stage1_lucky. Stage1_train_off
Fields terminated by ', 'optionally enclosed by' "' escaped by '"'
Lines terminated by '\ n'

CodePudding user response:

Use navicat_premium import
Convenient and quick
  • Related