0

Complete error:

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

This is the sql statement I am running which creates the error:

CREATE DATABASE IF NOT EXISTS db;

USE db;

CREATE TABLE IF NOT EXISTS A(
    id int NOT NULL,
    description text NOT NULL,
    PRIMARY KEY (id)
);

LOAD DATA INFILE 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\a.csv' 
INTO TABLE goal 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;

What I have tried to fix this error: in the my.ini file:

# This variable is used to limit the effect of data import and export operations, such as 
# those performed by the LOAD DATA and SELECT ... INTO OUTFILE statements and the 
# LOAD_FILE() function. These operations are permitted only to users who have the FILE privilege.
secure-file-priv=NULL

I have also tried commenting the line out. Still get the error mentioned above.

I moved a.csv to C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\ because I thought the premise of secure-file-priv was to only allow uploads from specific folder.

I do not know what to do. Neither solution worked. Will respond to any questions right away.

n3trunr
  • 1
  • 1

0 Answers0