1

I am using Amazon Rds as my sql database and navicat to make a connection to the database and running the sql files from navicat tools.

I had a sql files for creating table_schemas, add_constraints and loading_tables. The first two sql files are running successfully and could create a tables and relations between them using those. When I run this loading_tables facing an issue. This loading_tables have bunch of sql queries which take CSV files and make a record of them in table's that we created earlier. The below is one of the many queries from that file

select "loading data from labellers.csv" AS `-----`;
LOAD DATA LOCAL INFILE 'labellers.csv'
INTO TABLE `labellers`
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "|\n"
(`id`, `name`, @n0) 
SET `url` = IF(@n0 = '', NULL, @n0)
;
SHOW WARNINGS;

I expect to make a successful transaction on running this but ended up with this error.

[ERR] 2 - File 'labellers.csv' not found (Errcode: 2 "No such file or directory")
[ERR] select "loading data from labellers.csv" AS `-----`;
LOAD DATA LOCAL INFILE 'labellers.csv'
INTO TABLE `labellers`
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "|\n"
(`id`, `name`, @n0) 
SET `url` = IF(@n0 = '', NULL, @n0)
;
SHOW WARNINGS;

I do have the labellers.csv file in the same directory with this sql file but still says file not found. Any help is appreciated. Thanks in advance.

shashank
  • 327
  • 1
  • 4
  • 17

0 Answers0