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: | |
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
[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.