Click here to Skip to main content
15,885,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
SQL
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:
SQL
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.
Posted
Updated 19-Mar-14 5:01am
v3
Comments
Jawad Ahmed Tanoli 19-Mar-14 10:21am    
Provide your full file path.
Alamgirable 19-Mar-14 10:32am    
I provide the link of that file but it again gives me the error.
Jawad Ahmed Tanoli 19-Mar-14 10:36am    
you must provide where file is located like
'c:/worldcitiespop.txt'
Alamgirable 19-Mar-14 10:51am    
But i am working on my webhost not on my pc.
Jawad Ahmed Tanoli 19-Mar-14 10:46am    
read this hope it helps you
http://dev.mysql.com/doc/refman/5.1/en/load-data.html

1 solution

You would be better off contacting iPage support like this guy did[^]
Quote:
at iPage the ‘file path’ is called ‘document root’
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900