Search code examples
databasecsvsinglestore

Importing data into singlestore db using csv


I am new to MEMSQL and trying to restore data into MEMSQL db using .csv file but its below error ERROR 1017 ER_FILE_NOT_FOUND: Can’t find file: ‘\home\vagrant\filename.csv’ (errno: 2)

CSV data is imported from another server. I have memsql on virtual machine. I have copied table dump csv to \home\vagrant\ location. I am trying below command to restore data. LOAD DATA INFILE ‘\home\vagrant\filename.csv’ INTO TABLE “tableName” FIELDS TERMINATED BY ‘\t’ LINES TERMINATED BY ‘\n’;

Thanks in advance


Solution

  • Just to clarify, the filename.csv file is located inside the virtual machine running memsql or is located on same machine your running the LOAD DATA from?

    If the file is on the same machine your running LOAD DATA from you need to add the LOCAL keyword (LOAD DATA LOCAL INFILE ...)