Bug #92372 Error code: 1290 MySQL server running with --secure-file-priv option
Submitted: 11 Sep 2018 23:12 Modified: 12 Sep 2018 7:21
Reporter: Avinash Sorab Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S2 (Serious)
Version:8.0.12 OS:Windows
Assigned to: CPU Architecture:x86

[11 Sep 2018 23:12] Avinash Sorab
Description:
I'm just trying to run 

LOAD DATA INFILE 'D:\TPCH\customer.tbl' 
INTO TABLE customer
FIELDS TERMINATED BY '|'
LINES TERMINATED BY '\n';

and getting error message.

The error message says Error Code 1290:that MySQL server running with secure-file-priv option but I've tried disabling secure-file-priv option from Server -> Option File -> Security Tab -> Unchecking the secure file priv option and restarting the server. 
I even tried making this changes and reboot the system but somehow the error persists. I've checked my.ini config file to verify that the --secure-file-priv is commented out when I unchecked it from GUI. Still the error persists.

I even went ahead to see the system variables and check the value of --secure-file-priv only to witness that it is NULL. No matter what value --secure-file-priv has, or even it is disabled. The error code says the server is running with --secure-file-priv option.

The other commands like SELECT, are working file except for LOAD DATA INFILE

How to repeat:
Install MySQL Server, Workbench, Router, Shell all of v8.0.12.
Try running LOAD DATA INFILE commmand from the workbench and the error should be displayed.
[12 Sep 2018 7:21] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. 

Please ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_secure_file_pr...
- strict secure_file_priv

mysql> select @@secure_file_priv;
+--------------------+
| @@secure_file_priv |
+--------------------+
| NULL               |
+--------------------+
1 row in set (0.00 sec)

LOAD DATA INFILE 'D:\\MySQL\\fdef.txt' INTO TABLE test.datetimetest
  FIELDS TERMINATED BY '\t'
  LINES TERMINATED BY '\n';

WB:
12:35:27	LOAD DATA INFILE 'D:\\MySQL\\fdef.txt' INTO TABLE test.datetimetest   FIELDS TERMINATED BY '\t'   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.062 sec

CLI:
mysql> LOAD DATA INFILE 'D:\\MySQL\\fdef.txt' INTO TABLE test.datetimetest
    ->   FIELDS TERMINATED BY '\t'
    ->   LINES TERMINATED BY '\n';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
mysql>

^^ If set to NULL, the server disables import and export operations.

- less secure - secure_file_priv=""

mysql> select @@secure_file_priv;
+--------------------+
| @@secure_file_priv |
+--------------------+
|                    |
+--------------------+
1 row in set (0.00 sec)

WB:

12:42:03	LOAD DATA INFILE 'D:\\MySQL\\fdef.txt' INTO TABLE test.datetimetest   FIELDS TERMINATED BY '\t'   LINES TERMINATED BY '\n'	1 row(s) affected Records: 1  Deleted: 0  Skipped: 0  Warnings: 0	0.156 sec

CLI:
mysql> LOAD DATA INFILE 'D:\\MySQL\\fdef.txt' INTO TABLE test.datetimetest  FIELDS TERMINATED BY '\t'  LINES TERMINATED
BY '\n';
Query OK, 1 row affected (0.15 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 0

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.
[3 Jul 2019 6:18] jitendra kumar
LOAD DATA INFILE 'C:/CDRS_Daily_2940_2019-06-24.csv' INTO TABLE aat_cdr24 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n';

I GET THIS ERROR LOAD DATA INFILE 'C:/CDRS_Daily_2940_2019-06-24.csv' INTO TABLE aat_cdr24 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n';
[21 Aug 2023 13:10] MySQL Verification Team
Bug #112122 marked as duplicate of this one.