web analytics

ERROR 1148 (42000): The used command is not allowed with this MySQL version – LOAD DATA LOCAL INFILE

I was trying to populate a mysql database from contents inside a csv files as follows, when I got the error 🙁


mysql>LOAD DATA LOCAL INFILE ‘/home/abc/public_html/test.csv’ into table test_list;
ERROR 1148 (42000): The used command is not allowed with this MySQL version

To correct it, I did the following.


1) Open my.cnf and added the line “local-infile=1”  under [mysqld] and [mysql]

[mysqld]
local-infile=1

[mysql]
local-infile=1

Save and quit the file.

/etc/init.d/mysql restart

2) Grant file privilege for the user

mysql> grant file on *.* to user@’localhost’;

mysql>  flush privileges;

3) Restart mysql

/etc/rc.d/init.d/mysql restart


Now try load data command again, and yes!!!!! it works 🙂

One comment to ERROR 1148 (42000): The used command is not allowed with this MySQL version – LOAD DATA LOCAL INFILE

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>