0

I'm trying to import

LOAD DATA LOCAL INFILE "/home/frederic/cowtest.csv"
    INTO TABLE cow_db1 FIELDS TERMINATED BY ","
    ENCLOSED BY '"' LINES TERMINATED BY '\n'
    IGNORE 1 LINES (state_abb, c_code, state_name);

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

I connected mysql with M-x sql-mysql and

User = root
Password = .....
Database =
Server = localhost

But running directly from the shell after

mysql -h localhost -u root -p --local-infile

does not return the error but

Query OK, 243 rows affected (0.05 sec)
Records: 243  Deleted: 0  Skipped: 0  Warnings: 0

I tried with LOAD DATA LOCAL INFILE instead (has recommended in other solution) and then it returns ERROR 29 (HY000): File '/home/frederic/cowtest.csv' not found (Errcode: 13)

So it is likely that things goes unspecified about SQLi extension, and the --local-infile specification.

Many thanks
frederic

1 Answer 1

0

It seems variable "local_infile" is turned off before loading and if you specify "--local-infile" turns on this variable.

You can use following steps to load file

login mysql using mysql -uroot -p
set global local_infile to value 1
Then try load data local infile

Hope it helps

1
  • well I was considering more of an emacs way of doing so, but i'll do that way defining in the my.cnf defining the value local_infile = 1 for [mysql] and [mysqld]
    – fRed
    Oct 29, 2014 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.