开发者

MySQL cannot find data file for a load operation

I would like to load a 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've also tried:

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

I also gives me an error:

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

I've repe开发者_如何学Catedly checked the file path and name and I've also made sure the file privilege is set to Read & Write for everyone.

I am using a Mac and phpMyAdmin.

Any suggestions on what the problem may be?


I had the same problem using MacOs and tried to change permissions, etc, but I realized you have to use the same directory structure you have using 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';


I'm not too sure what the problem is but I made it work by moving the file to /tmp/test_data and used LOAD DATA INFILE...


I have had the same issue, trying to import an SQL file that uses LOAD DATA LOCAL INFILE... to import a CSV file in phpMyAdmin and got the same error message: #7890 - Can't find file 'myfile.csv'

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


I was having the same problem

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

7890 - Can't find file '

The first thing I did was move the files to the "Program File" directory It still wouldn't 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 its something to do with the path structure.

By the way I'm using Eclipse and phpMyAdmin on WAMP (windows operating system). I hope this helps.


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 to htdocs.


It is best if you put that text file in 'xammp /phpMyAdmin ' directory ( I assume you work on xammp) That's it. then LOAD DATA LOCAL INFILE will work. Happy Coding

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜