LOAD DATA INFILE Error Code : 13

后端 未结 19 2495
有刺的猬
有刺的猬 2020-11-28 02:37

In my remote MySQL, when I try to execute this query, I am getting the MySQL Error Code : 13.

Query -

LOAD DATA INFILE 
\'/httpdocs/.../.../testFile.         


        
19条回答
  •  眼角桃花
    2020-11-28 03:22

    I use Ubuntu 12.04, I had to create the table, then do one of these:

    Using local gives an error (mysql 5.5):

    > LOAD DATA LOCAL INFILE "file.csv" INTO table inverter FIELDS TERMINATED BY ',';
    ERROR 1148 (42000): The used command is not allowed with this MySQL version
    

    LOAD DATA INFILE command is disabled by default for security reasons, re-enable it here and it should work: https://stackoverflow.com/a/16286112/445131

    You can import the csv-file using mysqlimport:

    mysqlimport -u root -p --fields-terminated-by=',' --local dbname tablename.csv
    

    Note the csv-file must have same name before the extension as the table.

提交回复
热议问题