Simonlbc
Simonlbc

Reputation: 651

MySQL 5.6 isn't knowledgeable of LOAD DATA (for importing csv file)

After having created a table called Notes successfully, I want to import data from a csv file into my database into Notes from a csv file notes.csv:

mysql>         LOAD DATA LOCAL INFILE 'Books/notes.csv'
    ->         INTO TABLE Notes
    ->         FIELDS 
    ->                 TERMINATED BY '\t' 
    ->                 ENCLOSED BY '' 
    ->                 ESCAPED BY '\\'
    ->         LINES   
    ->                 STARTING BY '' 
    ->                 TERMINATED BY '\n' 
    ->         ;
ERROR 1148 (42000): The used command is not allowed with this MySQL version.


mysql> SELECT VERSION();
+-------------------------+
| VERSION()               |
+-------------------------+
| 5.6.30-0ubuntu0.15.10.1 |
+-------------------------+
1 row in set (0,00 sec)

apparently from https://dev.mysql.com/doc/refman/5.6/en/load-data.html LOAD TABLE is a legal clause in 5.6+.

What am I doing wrong?

Upvotes: 1

Views: 387

Answers (2)

Shadow
Shadow

Reputation: 34285

This is the expected error message if local_infile server system varibale is set to 0 (false), disabling local file uploads to the mysql server.

Upvotes: 2

Quassnoi
Quassnoi

Reputation: 425663

From the docs:

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

Upvotes: 2

Related Questions