When I run the code below in MySQL5.0, I will have a response like:
Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.
LOAD DATA LOCAL INFILE 'C:UsersDownloads2013-07 - Citi Bike Trip Data.csv' INTO TABLE citibike.stations FIELDS TERMINATED BY ',' LINES TERMINATED BY 'n' IGNORE 1 ROWS (@id, @startstationname, @startstationlatitude, @startstationlongitude) SET id = @id, Name =@startstationname, Latitude=@startstationlatitude, Longitude=@startstationlongitude;
I already set the local infile to On, but still not working, do I need to still change any parameter?
Advertisement
Answer
OK, I found the solution finally, we need to go to the MySQL Command Line Client (My version is 5.7), and change all the in the path to
/
, like
LOAD DATA LOCAL INFILE 'C:/Users/Downloads/2013-07 - Citi Bike Trip Data.csv'
In the workbench and cell will show us the different error, in the cell, the response is Error 1148, in the workbench is 2068.