Load local file to MySQL table
load data infile "/Users/*/*.tsv"
INTO TABLE bachub.prtimes
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES;
Then get error
Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
Check
SELECT @@global.secure_file_priv
> NULL
Create my.cnf
sudo vim /etc/my.cnf
[mysqld]
secure-file-priv = ""
Stop & Start
$ mysql.server stop
$ mysql.server start
Recheck
SELECT @@global.secure_file_priv
>
Load data file is success When @@global.secure_file_priv is empty.