Import CSV files to MySQL workbench

0

I have a .csv file that contains columns (vertically):

  • Product.1 (line1)
  • Product.2 (line2)

But when I do this query :

use test;

LOAD DATA LOCAL INFILE 'local' INTO TABLE tabela1;

It always gives me a warning to say that the attribute type of tabela1 is integer.

I have tabela1 set only with one attribute - product but whenever I type type varchar it changes to integer will be how I wrote the file? And what options do I choose? primary key , null ?

    
asked by anonymous 12.06.2015 / 21:29

1 answer

0

The following code works for the Mac, if using Windows put '/n' instead of '/r' :

use test; 

LOAD DATA LOCAL INFILE 'local' INTO TABLE tabela1 
fields terminated by ';' 
lines terminated by '\r'; 

;
    
13.06.2015 / 00:51