Skip to content
Advertisement

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

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.

Advertisement

Answer

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
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement