MYSQL, problem with characters importing csv

1

I am passing the Maxmind csv database to mysql and some accented characters are giving problem. In Latin a ? appears and in UTF nothing appears.

CSV   : Östra Frölunda
UTF8  :
LATIN1: ?stra Fr?lunda

I used the code below that I found on a site to import the whole file:

CREATE TABLE  'location' (
  'locID' int(10) unsigned NOT NULL,
  'country' char(2) default NULL,
  'region' char(2) default NULL,
  'city' varchar(45) default NULL,
  'postalCode' char(7) default NULL,
  'latitude' double default NULL,
  'longitude' double default NULL,
  'dmaCode' char(3) default NULL,
  'areaCode' char(3) default NULL,
  PRIMARY KEY  ('locID'),
  KEY 'Index_Country' ('country')
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;

load data infile 'GeoLiteCity-Location.csv' 
into table 'location' 
fields terminated by ',' optionally enclosed by '"' 
lines terminated by '\n' 
ignore 2 lines;

The csv has other cities with illegible characters, but these will not care at the moment, but wanted to import the way it is to later sanitize.

    
asked by anonymous 01.01.2015 / 18:25

0 answers