MYSQL - Error 1148. The used command is not allowed with this MSQL Version

4

Trying to load data into a table gives me this error.

  

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

The function I use is:

  

load local data infile 'C: \ Users \ xSyn \ File.csv'

I've been searching the internet and some say I have to execute the command

  

local-infile = 1

But I do not know how. In my own MySQL script I get an error and I do not know what to do anymore.

How can I solve this problem?

    
asked by xSyn 30.09.2018 в 20:59
source

1 answer

1

Assuming that the operating system is Windows (I see the parameter " C:\Users\xSyn... ") and that the command " load data local infile ..." is executed from the command line (" my own MySQL script em> ") I think there are two main ways to" set "the value of local-infile.

The first one is from mysql "prompt":

1) Go to mysql.exe folder. In my case it is MySQL 8 and the folder is C:\Program Files\MySQL\MySQL Server 8.0\bin but this depends on release:

2) Check status of local_infile: SHOW GLOBAL VARIABLES LIKE 'local_infile';

3) SET GLOBAL local_infile='ON';

4) Again SHOW GLOBAL VARIABLES LIKE 'local_infile'; to see if the parameter has changed. Last three steps are in the screenshot:

Another way (but I'm not sure about the exact value of the parameter) would be to set it up from Windows Services.

1) Go to Control Panel - > Administrative tools - > Services

2) Enclock MySQL. Mine is MySQL80 but this depends on the release. Stop the service with "Stop".

3) Open Properties with the right mouse button.

4) I'm not sure that you have to put exactly in the field " Parámetros de inicio ", if it is hyphen, underscore, ON, 1, etc. but something similar should work:

5) Inciar service.

    
answered by 29.11.2018 в 18:05