1

here is my table

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)
);

I'm trying to import a text file to my database following tutorial here.

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 I'm getting the following error message.

ERROR 1148 (42000): The used command is not allowed with this MySQL version

Any ideas?

Thank you

asked Jan 9, 2015 at 2:10
1
  • why do you not read the manual. A limk to the manual can be found in he article you are referencinng to. Commented Aug 16, 2015 at 11:02

1 Answer 1

1

From the MySQL Documentation on Security Issues with LOAD DATA LOCAL

If LOAD DATA LOCAL is disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:

ERROR 1148: The used command is not allowed with this MySQL version

How ? The server option local_infile must be disabled. Check your my.cnf for load_infile. If you are using a web hosting service, they may or may not allow it. For example, you cannot do that with Amazon RDS for MySQL. You might be able to get away with using MySQL in Amazon EC2. Check with your administrators in that respect.

answered Jan 9, 2015 at 3:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.