简体   繁体   中英

mysql csv file import issue

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM