[SOLVED] Import CSV into table – MySQL [Error Code: 2068]

Issue

I am getting this error :

Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.

I checked the SHOW GLOBAL VARIABLES LIKE ‘local_infile’ —— VALUE:ON

Also, I added to the advanced configuration of the connection the following OPT_LOCAL_INFILE=1.

I’m using this query

LOAD DATA LOCAL INFILE ‘/Users/hola/testingrow.csv’
INTO TABLE mytable

What am I doing wrong? Im working on a MAC

Thanks,

Solution

The file you are trying to import cannot be read by your SQL user. Update permissions on that file so that it can be read by anyone (chmod 7xx ) or create a local user for the SQL user on your local machine and grant it access to that file. Alternatively you could move that file to a directory which is already accessible by the SQL user.

Answered By – Cheese

Answer Checked By – Marie Seifert (BugsFixing Admin)

Leave a Reply

Your email address will not be published.