Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
980 views
in Technique[技术] by (71.8m points)

sql - MySQL LOAD DATA Error (Errcode: 2 - "No such file or directory")

I am trying to load data into a table of my MySQL database, and getting this error.

LOAD DATA LOCAL INFILE 'C:UsersMyselfDesktopBlah BlahLOAD DATAweek.txt' 
INTO TABLE week;

Reference: this

The path is hundred percent correct, I copied it by pressing shift and clicking "copy path as" and checked it many times. So any tips on this will be much appreciated. . My research: Seeing this answer, I tried by changing C:Users to C:\Users. It did not work for me.

Secondly, is there a way to use some kind of a relative path (rather than an absolute path) here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I spent 2 days on this and finally got my mistake, Just changing backslashes by forward ones, as one contributor previously said. And finally worked for me. so was:

LOAD DATA LOCAL INFILE 'C:/ProgramData/MySQL/MySQL Server 5.7/Data/menagerie/pet.txt' INTO TABLE pet;

I just can say thanks a lot.

p.s. don't waste time on ytb...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...