Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

load data local infile ERROR 2 file not found

Tags:

mysql

load

I've been ramming my face against this sql error for about 45 minutes, and I have a feeling it's going to be something silly.

I'm trying to load a .txt file into my database, which is on a server elsewhere. I'm using putty on windows 7.

The sql call I am using is the following: LOAD DATA LOCAL INFILE "C:/Users/Sam/Desktop/students_data.txt" INTO TABLE students;

The response I get is ERROR 2 (HYOOO): File 'C:/Users/Sam/Desktop/students_data.txt' not found (Errcode:2)

If anyone could shed some light on this that'd be extravagant. I already tried switching the / to \ and using single quotes, etc., but nothing seems to work. The file path is copied by shift+clicking the actual file and pasting it.

like image 445
samuel Avatar asked Oct 02 '11 01:10

samuel


1 Answers

Try to type path as C:\\mydir\\myfile.csv i.e. use \\ instead of \

like image 57
Bal Raj Sharma Avatar answered Sep 24 '22 07:09

Bal Raj Sharma