-
Get the CSV from geodatasource, contains the following:
GEODATASOURCE-CITIES-FREE.TXT GEODATASOURCE-COUNTRY.TXT GEODATASOURCE_LICENSE_AGREEMENT.PDF GEODATASOURCE-REGION.TXT GEODATASOURCE-SUBREGION.TXT README.HTML
-
Check
GEODATASOURCE-CITIES-FREE.TXT
. if it contains multiple line endings: resolve withdos2unix GEODATASOURCE-CITIES-FREE.TXT
-
Import the
city
CSV with:LOAD DATA LOCAL INFILE 'D:/Users/ZiriusPH/Desktop/New folder/GEODATASOURCE-CITIES-FREE.TXT' INTO TABLE `city` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (cc_fips,full_name_nd);
-
Import the
country
csv with:LOAD DATA LOCAL INFILE 'D:/Users/ZiriusPH/Desktop/New folder/GEODATASOURCE-COUNTRY.TXT' INTO TABLE `country` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (cc_fips,cc_iso,tld,country_name);