6

I have this code to upload CSV files into MySQL, I tried to upload the CSV files I created, but I keep getting this error when I run the code.

The code I'm trying to run is here:

Load Data Local Infile

'/Users/dylanpowell/Dropbox/Dylan Powell/Berkeley Investment Advisors/Dylans Stock Evaluations/Bottom Scores at 9-7-19.csv'

Into Table Stock_Evaluator_Raw_Scores 
    Fields Terminated by ','

    Enclosed by '"'

    Escaped by '\\'

    Lines terminated by '\n'
 Ignore 1 Lines; 

The error is below:

Error Code: 3948. Loading local data is disabled; this must be enabled on both the client and server side. Load Data Local Infile '/Users/dylanpowell/Dropbox/Dylan Powell/Berkeley Investment Advisors/Dylans Stock Evaluations/Bottom Scores at 9-7-19.csv'Into Table Stock_Evaluator_Raw_Scores Fields Terminated by ','Enclosed by '"' Escaped by '\\'Lines terminated by '\n' Ignore 1 Lines; 

I noticed there was another stack overflow for this issue, but I'm not sure how to implement those methods to get my code to run.

Dylan Powell
  • 61
  • 1
  • 1
  • 3

1 Answers1

11
  1. Open MYSQL Command Line

  2. Type in your password

  3. Enter the following:

    SHOW GLOBAL VARIABLES LIKE 'local_infile';

  4. If local_infile value is equal to false set it to true by:

    SET GLOBAL local_infile = true;

More info here: https://www.digitalocean.com/community/questions/how-to-enable-local-capability-in-mysql-workbench

akhoo
  • 111
  • 2
  • 3
    I did all the above but then get: Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access. – boardtc Sep 27 '22 at 16:18