I recently bought web hosting from ipage.com, Now i want to insert Maxmind world cities database into my mysql database.
I download the text file from:
http://www.maxmind.com/en/worldcities[
^] named "worldcitiespop.txt".
After downloading complete i insert that file into the root directory of my web host.
So, the link look like this:
http://www.example.com/worldcitiespop.txt
Now first i use this command to create table and rows:
CREATE TABLE cities (
country CHAR(2),
city_ascii VARCHAR(100),
city VARCHAR(255),
region CHAR(2),
population INT UNSIGNED,
latitude DECIMAL(10, 6),
longitude DECIMAL(10, 6),
INDEX idx_lat_long (latitude, longitude),
INDEX idx_country (country),
INDEX idx_region (region)
);
After the success of table and rows creation i use this command to load data into rows:
LOAD DATA LOCAL INFILE 'worldcitiespop.txt' INTO TABLE cities
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(country, city_ascii, city, region, population, latitude, longitude);
But at that point it gives me the error:
#2 - File 'worldcitiespop.txt' not found (Errcode: 2).
I also provide the link of that file but it again gives me the error.
I test this code also on my PC its works perfectly.
Please help me....
Thanks.