DatsunBing
DatsunBing

Reputation: 9076

Why can't MySql read this file?

Using PHPMyAdmin, I am trying to import a file via the following syntax...

LOAD DATA INFILE '/home/kim/development/www/ref_data/ISO_3100_Country_Codes.txt'
INTO TABLE country 
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\r\n'
IGNORE 2 LINES
(name, code);

... but I get an error saying the file is not found (Errcode 13).

I am using Ubuntu 11.10 and the permissions on the file are 777.

I am logged in as root and the root user has the FILE privilege.

I looked at using the LOCAL keyword, but that threw a PHP Error (and I'd prefer not to have to haul the table over the client-server connection each time I want to import it).

The file system layout is per the Ubuntu default.

There have been no changes to the privileges since the server restarted, however I ran FLUSH PRIVILEGES just to be sure. It made no difference.

Any assistance appreciated!

Upvotes: 0

Views: 256

Answers (1)

Risto
Risto

Reputation: 85

Have you tried from mysql console? You will need the LOCAL keyword. Otherwise the command looks similar to what I did last week, should work ;-)

Upvotes: 1

Related Questions