/* NOTE: Be sure that you have a database created to import into and all the map files are located in the databases data directory for example - c:/mysql/data/db_name To load the map data, just copy and paste the following in to the MySql command line. */ select 'Truncating Destination Tables' as ''; -- Delete Data From All Tables truncate table Subnets; truncate table Cities; truncate table Regions; truncate table Countries; truncate table Dmas; truncate table ProxyNetworks; truncate table PrivateAddresses; truncate table Nbc; /* Some versions of MySql do not support truncate table commands, so there are delete commands included below. */ delete From Subnets; delete From Cities; delete From Regions; delete From Countries; delete From Dmas; delete From ProxyNetworks; delete From PrivateAddresses; delete From Nbc; select 'Loading Data Files Please Wait ...' as ''; -- Load Data From Flat Files LOAD DATA INFILE 'Subnets.txt' INTO TABLE Subnets FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES; LOAD DATA INFILE 'Cities.txt' INTO TABLE Cities FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES; LOAD DATA INFILE 'Regions.txt' INTO TABLE Regions FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES; LOAD DATA INFILE 'Countries.txt' INTO TABLE Countries FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES; LOAD DATA INFILE 'Dmas.txt' INTO TABLE Dmas FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES; LOAD DATA INFILE 'ProxyNetworks.txt' INTO TABLE ProxyNetworks FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES; LOAD DATA INFILE 'PrivateAddresses.txt' INTO TABLE PrivateAddresses FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES; LOAD DATA INFILE 'Nbc.txt' INTO TABLE Nbc FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;