Bug #83489 Unable to "Load data Infile"
Submitted: 23 Oct 2016 16:50 Modified: 24 Oct 2016 12:24
Reporter: nguyen duc Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7 OS:Windows
Assigned to: CPU Architecture:Any

[23 Oct 2016 16:50] nguyen duc
Description:
Hi , 

I just downloaded and installed Mysql 5.7 Windows x64 on my Windows 7 PC 

i am testing the Load Data feature on an existing table 

load data infile 'tran_lim2_ap.csv' into table sakila.test 

But i get the error "1290" , The MySQL server is running with the --secure-file-priv option so it cannot execute this statement 

I put my file in the directory pointed by this variable, and check its value with "show variables" but i always have this error. Or set secure-file-priv value  to my used directory none of this works. 

It is really annoying because i can't evaluate MySQL for my use. For me this security option is really uneeded. 

The import wizard uses Insert row by row , so it is really very low ! Load data should be used instead

How to repeat:
Try a Load data infile operation
[23 Oct 2016 23:52] MySQL Verification Team
Thank you for the bug report.

C:\ProgramData\MySQL\MySQL Server 5.7\Uploads>type mytable.txt
1,3
2,4
C:\ProgramData\MySQL\MySQL Server 5.7\Uploads>c:\dbs\5.7\bin\mysql -uroot -p
Enter password: *********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.7.16-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE D;
Query OK, 1 row affected (0.00 sec)

mysql> USE D
Database changed
mysql> CREATE TABLE mytable (col1 int, col2 int);
Query OK, 0 rows affected (0.27 sec)

mysql> SHOW VARIABLES LIKE "secure_file_priv";
+------------------+------------------------------------------------+
| Variable_name    | Value                                          |
+------------------+------------------------------------------------+
| secure_file_priv | C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\ |
+------------------+------------------------------------------------+
1 row in set (0.00 sec)

mysql> LOAD DATA INFILE 'C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/mytable.txt' INTO TABLE mytable FIELDS TERMINATED BY ',';
Query OK, 2 rows affected (0.11 sec)
Records: 2  Deleted: 0  Skipped: 0  Warnings: 0

mysql> SELECT * FROM mytable;
+------+------+
| col1 | col2 |
+------+------+
|    1 |    3 |
|    2 |    4 |
+------+------+
2 rows in set (0.00 sec)

mysql>
[24 Oct 2016 12:24] nguyen duc
Hello, 
With your example, i realise that i didn't use an absolute path, but just  give the file name thinking that mysql will search in the directory pointed by 'secure-file-priv'. 
I thiank that the error message could be improved, a file not found in directory xxx should be much more clear than the standard 1290 error.