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

后端 未结 12 1306
感动是毒
感动是毒 2020-11-27 03:46

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 questi

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 04:29

    Also struggled with this issue, trying to upload .csv data into AWS RDS instance from my local machine using MySQL Workbench on Windows.

    The addition I needed was adding OPT_LOCAL_INFILE=1 in: Connection > Advanced > Others. Note CAPS was required.

    I found this answer by PeterMag in AWS Developer Forums.


    For further info:

    SHOW VARIABLES LIKE 'local_infile'; already returned ON and the query was:

    LOAD DATA LOCAL INFILE 'filepath/file.csv' 
        INTO TABLE `table_name`
        FIELDS TERMINATED BY ',' 
        ENCLOSED BY '"'
        LINES TERMINATED BY '\n'
        IGNORE 1 ROWS;
    

    Copying from the answer source referenced above:

    Apparently this is a bug in MYSQL Workbench V8.X. In addition to the configurations shown earlier in this thread, you also need to change the MYSQL Connection in Workbench as follows:

    1. Go to the Welcome page of MYSQL which displays all your connections
    2. Select Manage Server Connections (the little spanner icon)
    3. Select your connection
    4. Select Advanced tab
    5. In the Others box, add OPT_LOCAL_INFILE=1

    Now I can use the LOAD DATA LOCAL INFILE query on MYSQL RDS. It seems that the File_priv permission is not required.*

提交回复
热议问题