MySQL mysql工作台加载数据本地infile找不到文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15166079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mysql workbench load data local infile cannot find file or directory
提问by Daniel Williams
Anyone else having problem using:
其他人在使用时遇到问题:
LOAD DATA LOCAL INFILE 'c:/PRODUCT_GROUP_UPLOAD.CSV' into TABLE ats_store.product_group
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
ESCAPED BY '"' LINES TERMINATED BY '\r\n'
(product_group_id,name,price,description,image,start_time,end_time,start_date,end_date,product_code,delivery_format);
Mysql Workbench has been buggy for a few weeks now, but I can't even find the file. Also, I updated today!
Mysql Workbench 几个星期以来一直有问题,但我什至找不到该文件。另外,我今天更新了!
I get:
我得到:
Error Code: 2. File 'c:\PRODUCT_GROUP_UPLOAD.CSV' not found (Errcode: 2 - No such file or directory)
I have loaded other files, but can't seem to get this one loaded? It's def in the folder I specify!
我已经加载了其他文件,但似乎无法加载这个文件?它在我指定的文件夹中!
Keep in mind that i already played with the slashes, forward, backward, double forward, double backward, etc...
请记住,我已经玩过斜线,向前,向后,向前翻倍,向后翻倍等......
回答by Daniel Williams
Windows path names are specified using forward slashes rather than backslashes. If you do use backslashes, you must double them.
Windows 路径名是使用正斜杠而不是反斜杠指定的。如果确实使用反斜杠,则必须将它们加倍。
回答by theGabyRod
I had the same problem your path should be using ""
我有同样的问题你的路径应该使用“”
"C:\PRODUCT_GROUP_UPLOAD.CSV" if running from workbench
回答by Mike Lischke
LOAD DATA LOCAL requires the file to be on the client machine. Is this the case for you?
LOAD DATA LOCAL 要求文件位于客户端计算机上。这是你的情况吗?
Since you wrote you have already loaded other files I assume your server and client have been the same for all attempts and only this single file fails to load. I write this because LOCAL support can be switched off (see also http://dev.mysql.com/doc/refman/5.6/en/load-data-local.html).
自从您编写以来,您已经加载了其他文件,我假设您的服务器和客户端在所有尝试中都是相同的,并且只有这个文件无法加载。我写这个是因为可以关闭本地支持(另见http://dev.mysql.com/doc/refman/5.6/en/load-data-local.html)。
Mike
麦克风
回答by user1779434
Try moving the data file to a test directory not under "documents and settings" or its children. Windows may be restricting access to that area. Then test your LOAD INFILE statement again.
尝试将数据文件移动到不在“文档和设置”或其子目录下的测试目录。Windows 可能会限制对该区域的访问。然后再次测试您的 LOAD INFILE 语句。