Search code examples
mysqlcsvload-data-infileworkbench

MySQL 8.0 / Workbench on Windows : Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access


I'm trying to run a LOAD DATA LOCAL INFILE from a file on my C:\ drive into an existent table, logged at root in Workbench. I've researched it all afternoon, set local_infile=1, set secure_file_priv='', granted file access to my user, flushed privileges, tried forward and backslashes but can't seem to get round the problem. Error 2068 doesn't really tell you much in the manual either. Any other suggestions?

I'm running on Windows 10, latest MySQL versions (as of last week - its a fresh install) and the table I'm trying to insert into is really simple. Its clearly a permissions problem, but running as root on a windows instance where I'm admin surely shouldn't be a problem?

Code is "LOAD DATA LOCAL INFILE 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/filename.csv' INTO TABLE tablename;


Solution

  • You should check that folder where the file you are trying to load is and confirm that you have the necessary permissions. If you have the permissions for the folder then check the file. You should used the properties options by right clicking on the folder or on the file.

    Properties Window

    EDIT: Also try the instruction with only LOAD DATA INFILE without the LOCAL statement. That made it worked for me.