Frage

I am trying to run this query

LOAD DATA CONCURRENT INFILE 'C:\\Data-API.csv' INTO TABLE pbp_person
FIELDS TERMINATED BY '\t' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES
(email, first_name, last_name, title, company_name, address, city, state, zip, country, phone, vertical);

but I get an error saying....

SQL Error(29) File 'C:\Data-API.csv' not found (Errcode:2)

The file is in the right place; what's happening?

War es hilfreich?

Lösung

Is the file in the server? Because you have not specified LOCAL, so the file must be specified on the server host.

If it is in the client then use this:

LOAD DATA CONCURRENT *LOCAL* INFILE 'C:\\Data-API.csv' INTO TABLE pbp_person
FIELDS TERMINATED BY '\t' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES
(email, first_name, last_name, title, company_name, address, city, state, zip, country, phone, vertical);

Refer this.

If LOCAL is not specified, the file must be located on the server host and is read directly by the server. The server uses the following rules to locate the file:

  • If the file name is an absolute path name, the server uses it as given.

  • If the file name is a relative path name with one or more leading components, the server searches for the file relative to the
    server's data directory.

  • If a file name with no leading components is given, the server looks for the file in the database directory of the default
    database.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top