After update mysql2, LOAD LOCAL file asks to stream
See original GitHub issueWhen using mysql2 1.6.5 with TypeORM and running the query bellow, everything goes as expected, but after upgrade to 2.02 version, I get this error.
// CODE
this.connection.query(`
LOAD DATA INFILE '/home/data.csv' INTO TABLE studio_data
FIELDS TERMINATED BY ',';
`)
// ERROR
As a result of LOCAL INFILE command server wants to read /home/data.csv file,
but as of v2.0 you must provide
streamFactory option returning ReadStream.
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
6.1.6 Security Considerations for LOAD DATA LOCAL
The LOAD DATA statement loads a data file into a table. The statement can load a file located on the server host, or,...
Read more >Fix: Using Load Data Local Infile - MySqlConnector
MySQL Server supports a LOAD DATA command that can bulk load data from a CSV or TSV file. This normally loads data from...
Read more >ERROR: Loading local data is disabled - this must be enabled ...
After searching online, I fixed it by these steps: ... mysql> use menagerie Database changed mysql> load data local infile '/path/pet.txt' ...
Read more >How to Load Data From File to Table in MySQL? 3 Easy ...
mysql > LOAD DATA LOCAL INFILE '/path/product.txt' INTO TABLE ... ENABLE KEYS command after loading the file. ... ON DUPLICATE KEY UPDATE.
Read more >MySQL load data infile ERROR 1064 - DBA Stack Exchange
Why dows you use LOCAL ? does your client works with remote MySQL, and source file is local for client and remote for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Finally ORM: TypeORM - https://typeorm.io/ node-mysql2 VERSION: 2.1.0
Connection
Query
I have follow this example: https://github.com/sidorares/node-mysql2/blob/dbf48879f517b8ebefc9fbdc5508a20b84f833ec/test/integration/connection/test-load-infile.js#L26-L38
@scriptsure, maybe my example can help you
@sidorares thanks very much for helping me with this issue. Everything works great. Really appreciate it!!! 👍