Reputation: 463
I am getting this error "LOAD DATA LOCAL INFILE file request rejected due to restrictions on access" while working on MySQL workbench. I am new to Mysql. I found a similar post in StackOverflow but none of them work for me.
CREATE DATABASE assignment02;
USE assignment02;
CREATE TABLE `hss_electives`(
sno INT NOT NULL UNIQUE,
roll_number INT,
sname CHAR(50) NOT NULL,
cid CHAR(50),
cname CHAR(50) NOT NULL,
PRIMARY KEY(roll_number, cid)
);
LOAD DATA LOCAL infile 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/hss_electives.csv'
INTO TABLE hss_electives
fields terminated BY ','
lines terminated BY '\n'
ignore 1 rows;
My local_infile option is set to "ON"
My secure_file_priv is set to the same directory where my CSV file is.
Upvotes: 1
Views: 4023
Reputation: 463
Finally, I got this answer, There is two way to correct this error :
As pointed by Akina, Removing "local" word from load data local infile worked!.
Solution without removing local keyword :
Upvotes: 1