MySQL cannot find data file for load operation

I would like to load the data file into MySQL using the following command:

LOAD DATA LOCAL INFILE '/Users/David/Desktop/popularity20110511/test_data' INTO TABLE test_table 

The above command gives me the following error:

 #7890 - Can't find file '/Users/David/Desktop/popularity20110511/test_data'. 

I also tried

 LOAD DATA INFILE '/Users/David/Desktop/popularity20110511/test_data' INTO TABLE test_table 

I also give me an error

 #13 - Can't get stat of '/Users/David/Desktop/popularity20110511/test_data' (Errcode: 13) 

I have repeatedly checked the path and file name, and I also made sure that the file privilege is set to Read & Write for everyone.

I am using Mac and phpMyAdmin.

Any suggestions on what might be the problem?

+4
source share
6 answers

I'm not too sure what the problem is, but I got it working by moving the file to /tmp/test_data and using LOAD DATA INFILE...

0
source

I had the same problem using MacOS, and I tried to change permissions, etc., but I realized that you need to use the same directory structure as in the terminal application. Example: if you have (localhost/myproject/myfile.csv) try using

 (Applications/XAMPP/htdocs/myproject/myfile.csv). LOAD DATA LOCAL INFILE '/Applications/XAMPP/htdocs/myproject/myfile.csv' INTO TABLE `mytable` FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r'; 
+7
source

I had the same problem trying to import a SQL file that uses LOAD DATA LOCAL INFILE ... to import a CSV file into phpMyAdmin and received the same error message: # 7890 - Cannot find the file 'myfile.csv'

The solution I found is to put the file in the same folder as phpMyAdmin.

+1
source

I had the same problem

'C: / Program Files / DatabaseTableHolders / Menu.csv'

7890 - Cannot find file '

The first thing I did was move the files to the "Program File" directory. It still does not work

Then I changed the path address from

'C: / Program Files / DatabaseTableHolders / Menu.csv'

to

'C: \ Program Files \ DatabaseTableHolders \ Menu.csv'

THIS WORKS !!!
For me, this has something to do with the structure of the path.

By the way, I use Eclipse and phpMyAdmin for WAMP (Windows operating system). Hope this helps.

+1
source

Yes, I meet the same error. My situation: XAMPP + MAC OS 10.9

 load data local infile '/Applications/XAMPP/xamppfiles/htdocs/jsonSQL.txt' into table `ttlegs` fields terminated by ',' lines terminated by '\n' 

and this works when I put jsonSQL.txt in htdocs.

0
source

Best of all, if you put this text file in the "xammp / phpMyAdmin" directory (suppose you are working on xammp). It is he. then LOAD DATA LOCAL INFILE will work. Happy coding

0
source

All Articles