0

Using MySQL on Mac OSX. When executing the following statement (from MySQl workbench), I met with the following error,

I tried to start MySQL manually using sudo /usr/local/mysql/support-files/mysql.server start without any options, but still have this error. Wondering if any solutions?

I searched some solutions and looks like on Windows there are some .ini config files, but have not found any solutions on Mac OSX. Thanks.

LOAD DATA INFILE '/Users/foo/Downloads/import.csv' 
INTO TABLE tasks 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement    0.0043 sec

1 Answer 1

1

Best is to put the file into the server's data directory before trying to load it, for security reasons. Read more about LOAD DATA in the docs, especially about the input file location. Note also: the secure-file-priv option can be set in a config file, hence manually starting the server without any additional option will not change its behavior compared to the normal start.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Mike, vote up for your reply. Wondering how to find the data directory on Mac OSX? I read your referred document and seems no answer.
Thanks for all the help Mike, mark your reply as answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.