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

sosytee picture sosytee · Aug 26, 2013 · Viewed 146.6k times · Source

I am trying to load data into mysql database using

LOAD DATA LOCAL
INFILE A.txt
INTO DB
LINES TERMINATED BY '|';

the topic of this question is the response I get. I understand the local data offloading is off by default and I have to enable it using a the command local-infile=1 but I do not know where to place this command.

Answer

arkascha picture arkascha · Aug 26, 2013

You can specify that as an additional option when setting up your client connection:

mysql -u myuser -p --local-infile somedatabase

This is because that feature opens a security hole. So you have to enable it in an explicit manner in case you really want to use it.

Both client and server should enable the local-file option. Otherwise it doesn't work.To enable it for files on the server side server add following to the my.cnf configuration file:

loose-local-infile = 1